1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

passing date value from calendar to a table through a query

Discussion in 'MS Access' started by bob006, Sep 7, 2009.

  1. bob006

    bob006 New Member

    Joined:
    Aug 20, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    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
     
  2. nimesh

    nimesh New Member

    Joined:
    Apr 13, 2009
    Messages:
    770
    Likes Received:
    20
    Trophy Points:
    0
    Occupation:
    Oracle Apps Admin
    Location:
    Mumbai
    Home Page:
    It should work, yo might be missing something.

    Can you attach your database file here?
     

Share This Page