Results 1 to 2 of 2
  1. #1
    RawToast is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    7

    DLookUp Flashing Error

    Hello,
    I managed to solve this issue on my own, but I thought I would post my experience here in hopes that it might be useful to someone else. I made a form for a table which contains client questionnaire responses, "Dec4Docs". I wanted to include the names of these clients in the form, just to make everything easier for whoever is doing data entry, but client names are in a different table, "BasicInformation". Both the questionnaire table and the client information table use a common ID number, "WISnum". I found a
    number of online tutorials which instructed me to use the DLookUp function for what I'm doing.

    This site here, for example, suggests the following formula:

    =DLookup("CustomerID", "Orders", "OrderID = " & Forms![Orders]!OrderID)

    Which I adapted to:

    =DLookUp("FirstName","BasicInformation","WISnum=" & [Forms]![Dec4DocsForm]![WISnumField])



    ^
    This was meant to find FirstName in the BasicInformation table where WISnum is equal to the WisnumField of the Dec4DocsForm form. Instead, all I got was a flashing error message that partially broke the program's GUI. I could not find a solution on Google, so I played around for awhile, bug checking by adding and removing things to the formula, until I finally got a little lucky and figured this out:

    =DLookUp("FirstName","BasicInformation","WISnum=" & '[Forms]![Dec4DocsForm]![WISnumField]')

    I hate that this was the solution. It still feels wrong. Practically speaking, this seems to be good enough for what I'm doing. I hope it is good enough for whoever finds this post.

    Let me know if you found this helpful, or if there is a better way to do this. Unfortunately, I cannot post my database because it contains sensitive client information.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2013
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Here's the usual way to specify a string:
    =DLookUp("FirstName","BasicInformation","WISnum='" & [Forms]![Dec4DocsForm]![WISnumField] & "'")

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Main page Form flashing button
    By benh in forum Forms
    Replies: 2
    Last Post: 09-19-2014, 05:17 PM
  2. Replies: 6
    Last Post: 12-30-2011, 01:07 PM
  3. Flashing textbox
    By coach32 in forum Forms
    Replies: 1
    Last Post: 11-22-2011, 02:22 AM
  4. subclassing a form to control flashing
    By swt1951swt in forum Forms
    Replies: 0
    Last Post: 07-14-2009, 05:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums