passing date value from calendar to a table through a query

bob006's Avatar
Newbie Member

I am using a calendar and a table in a subform (ms access 2003). Table has a field called "Game date" which is set to =date() [current date]. When i click a date in the calendar i want the table in the form filtered with the selected date in the calendar. i tried the following code but does not work. i am able to take the value to a text box. can anyone help me please?

Private Sub UnoCalendar_Click()

Dim dt As Date
dt = Me.UnoCalendar.Value
strsql = "SELECT * FROM UNO WHERE [GameDay] = " & dt
Me.FormUno.Form.RecordSource = strsql
End Sub

GameDay is the date field in the table (UNO) ."FormUno" is the name of the subform
nimesh's Avatar, Join Date: Apr 2009
Invasive contributor
It should work, yo might be missing something.

Can you attach your database file here?