Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2005
    Posts
    61

    Unanswered: Search question / receiving error

    Hello to all.

    I am running the following:

    strGlobalCSRUNumber = InputBox(Message, Title, Default)

    strGlobalCSRName = DLookup("[CSR_Name]", "CSR_Name_Listing", "[CSR_U_Number] = '" & strGlobalCSRUNumber & "'")

    What this does is goes through a table until it finds a value that matches the strGlobalCSRUNumber. The problem that I'm having is that if the person is not entered into the table yet. I received the error message "invalid use of null"

    How can I have it search the table and if it doesn't find the value stop so I can ask to confirm the number?

    Thanks for all your assistance.

    Micahyah

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    put a conditional around the dlookup

    eg
    if not isnull(strGlobalCSRUNumber) then
    strGlobalCSRName = DLookup("[CSR_Name]", "CSR_Name_Listing", "[CSR_U_Number] = '" & strGlobalCSRUNumber & "'")
    endif

    'you may need some other construct
    eg
    if not strGlobalCSRUNumber=NULL or len(strGlobalCSRUNumber)>0 then

Posting Permissions

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