Results 1 to 2 of 2

Thread: DLookup isnull

  1. #1
    Join Date
    Dec 2003

    Unanswered: DLookup isnull

    Trying ti display a msgbox if the value in DLookup does not exists.
    Ex. Using Dlookup to read an order number in a table, and displays msgbox("Not exist"). How do I check if the Lookup value exist using code?

  2. #2
    Join Date
    Nov 2003
    Place your DLookUp function into a IsNull function so as to test to see if there is a non Null return:

    If Not IsNull(DLookUp("[myThingy], "MyThingyTable", "[ThisThingy] = '" & Me.ThatThingy & "'")) Then
      Me.MyThingaMaGig = DLookUp("[myThingy], "MyThingyTable", "[ThisThingy] = '" & Me.ThatThingy & "'")
    End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts