Microsoft Access 2007 DLookup question RRS feed

  • Question

  • 'Not quite sure which forum to ask but since this is a VBA question, this seemed like a good place :).

    The following statement gives me a Runtime Error 94: Invalid use of Null:

            dim intVisitID as integer

            intVisitID= DLookup("VisitID", "Visits", "[VisitDate] = 3/8/2008")

    I'm trying to see if any table entries is Table "Visits" have a "VisitDate" entry (which has a Date/Time format) equal to today.  As a test case, I hardcoded today's date... my next step was to use the "Date()" function. Note that all 5 entries in teh Visits table have date/time values.

    FYI: This is within a form class module in Access 2007.

    Can anyone help?


    • Moved by Riquel_Dong Wednesday, August 6, 2008 7:14 AM redirect to the VBA forum (Moved from Visual Basic Language to Off-Topic Posts (Do Not Post Here))
    Monday, August 4, 2008 1:16 AM

All replies

  • For ( VBA ) the Visual Basic in ACCESS or EXCEL or WORD or other OFFICE applications please read this.

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Wednesday, August 6, 2008 7:08 AM