I'm working on MS Access, using Northwind DB. I'm trying to to add a calendar in a form and link it with the dbo_orders table. such that i can retrieve how many orders made on particular day by clicking on the date in calendar.
Ex. Consider the dbo_Orders in Northwind DB. If I click on 11/11/1996 button in the calendar it should show what all the things happened on that particular day below. i.e on the same screen having two segments, one segment above has calendar and below that should show details of that particular day upon clicking specific date.
I need to work on this, Your solution would be appreciated.
Thank you.
I'm going to tell you how to do it without telling you how to do it.
Anytime you want to capture some "event" you're going to have to write code for it (or a Macro, but I don't like 'em). Simple as that.
So, there are a number of events we can use to target this functionality. What makes the most sense, from reading your question, is the
OnChange
event for your search text box.So, if I was going to target a text box to capture some event, I would view the Form in design view, right click the text box, select
Properties
, click on theEvent
tab, and selectOn Change
(the[...]
to the right side), and finally selectCode Builder
.So, what do you want to do? You want to capture the
Text
in the text box (because select the date doesn't change the.Value
of it, and use that essentially in theWHERE
clause of a query (whether it'sApplyFilter
or whatever)In the Sub Routine for the
Text##_Change()
event, I would probably declare aDate
variable, and do something like..With that variable, you can use it as a filter, use it in a query or inline SQL, or do whatever you want with it. Since you're using a split form, you can use
Me.Filter
and then apply theFilter
.