Troubles with date variable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rod4
    New Member
    • Jun 2015
    • 17

    Troubles with date variable

    hello guys,

    my goal is to open with doubleclick a record in a datasheet a form where i can see the records full page with more informations. so i dblclick on the field IDate and the form opens with the correct date and according informations in the record of this date.

    the modul looks as follows:

    Code:
    Private Sub Info_DblClick (Cancel as Integer)
    
        DoCmd.OpenForm "InfoForm" ,,, "[IDdate] =" & [IDdate]
    
    End Sub
    my problem is, the form is always empty.

    when i use the [infoID] instead of [IDate], then i get the correct record to the field [infoID]. but i want to use the IDate.

    what do i do wrong?
    Last edited by Rabbit; Jul 1 '15, 11:32 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    #2
    Date values need hashtags surrounding them. So your WhereCondition clause needs to be
    Code:
    "[IDdate] = #" & [IDdate] & "#"

    Comment

    • rod4
      New Member
      • Jun 2015
      • 17

      #3
      thanks a lot! i had this idea already too, but with the wrong syntax! :)

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32653

        #4
        Please check your questions carefully before posting. In various different parts of the thread you have referred to [IDate] & [IDdate]. It's very hard to work with unreliable information.

        Comment

        • rod4
          New Member
          • Jun 2015
          • 17

          #5
          Sorry won't happen again!

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32653

            #6
            : - )

            Comment

            Working...