Results 1 to 3 of 3
  1. #1
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398

    displaying a date using DLookup

    On a form, I have a combobox. The user selects a record from the combo box. Their are fields that are populated once the combobox selection is executed. Here's a sample dlookup funtion that is working:
    =DLookUp("FreightPO","tblProductPrintRuns","PrintR unID ='" & [Combo7] & "'")

    If the field is a date field, when the form is opened, the date field is flashing. Upon making a combobox selection, within the date field, the error is #Name


    Here is the dlookup function within the date field:
    =DLookUp("Pick-UpDate","tblProductPrintRuns","PrintRunID ='" & [Combo7] & "'")

    What do I need to fix? Thanks in advance!

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Because of the special character (the dash - ) you have in the field name, you need to put it in square brackets:

    =DLookUp("[Pick-UpDate]","tblProductPrintRuns","PrintRunID ='" & [Combo7] & "'")

    (It makes life SOOOOOO much easier if you do not use special characters or spaces in object or field names)

  3. #3
    crowegreg is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Posts
    398
    Thanks Bob. As we all know, we learn best by our mistakes.

    I'll change the field name.

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

Similar Threads

  1. Not Displaying a : or ,
    By hawkins in forum Forms
    Replies: 9
    Last Post: 08-12-2011, 11:39 AM
  2. Replies: 1
    Last Post: 06-17-2011, 12:59 AM
  3. Return DLookup result as date?
    By kman42 in forum Access
    Replies: 8
    Last Post: 04-22-2011, 11:35 AM
  4. Displaying Value and not ID
    By jonny in forum Access
    Replies: 3
    Last Post: 10-19-2009, 08:21 AM
  5. Displaying a PDF in a Form
    By Chaz in forum Forms
    Replies: 0
    Last Post: 08-07-2006, 03:26 PM

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