Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MS Access (http://www.go4expert.com/forums/ms-access-forum/)
-   -   passing date value from calendar to a table through a query (http://www.go4expert.com/forums/passing-date-value-calendar-table-query-t19332/)

bob006 7Sep2009 17:34

passing date value from calendar to a table through a query
 
Hi,

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 13Sep2009 14:14

Re: passing date value from calendar to a table through a query
 
It should work, yo might be missing something.

Can you attach your database file here?


All times are GMT +5.5. The time now is 22:49.