Results 1 to 8 of 8
  1. #1
    cec is offline Advanced Beginner
    Windows 2K Access 2003
    Join Date
    Apr 2012
    Posts
    42

    DLookup isn't working

    I have two forms...frm1 has a text box with an expression in it and I need frm2 to display the result of the expression. I'm using the DLookup expression and it either gives me #Name? or #Error? message in the text box frm2.



    =Dlookup("[loan#]","tbl_loan","[Days] =" & Forms![frm1]!Days) <that gives me #Name? message

    Can someone help me please I have tried everything...........i think!

    Thanks!

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    http://www.databasedev.co.uk/dlookup.html

    Look here to ensure that your syntax for quotes is correct.

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Does the table "tbl_loan" have fields "Days" and "loan#" (this is a bad name for a field - should only use letters, numbers and/or the underscore in names)
    Is there a control on "frm1" named "Days"?
    Is "Days" a number (like 3 or 6) or a date?

  4. #4
    cec is offline Advanced Beginner
    Windows 2K Access 2003
    Join Date
    Apr 2012
    Posts
    42
    "tbl_loan" does have fields "Days" and "loan#".

    Yes there is a control on "frm1" named "Days"
    Yes "Days" is a number.

  5. #5
    cec is offline Advanced Beginner
    Windows 2K Access 2003
    Join Date
    Apr 2012
    Posts
    42
    all the the information populates just fine on frm1(which i have expression built into the form)

    its just frm2 I need the resulst to populate as they are in frm1. it will only populate the fields that do not have an expression in it.

  6. #6
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    "frm1" AND "frm2" are open at the same time?

  7. #7
    cec is offline Advanced Beginner
    Windows 2K Access 2003
    Join Date
    Apr 2012
    Posts
    42
    no. frm1 you can edit. frm2 you can not edit the "Days" text box.

  8. #8
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Code:
    =Dlookup("[loan#]","tbl_loan","[Days] =" & Forms![frm1]!Days)
    Since this expression is in a control on "frm2", "frm1" MUST be open also since you are referring to the control named "Days" on the form "frm1".

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

Similar Threads

  1. PLEASE HELP! Dlookup event not working....
    By emailloni in forum Forms
    Replies: 11
    Last Post: 01-10-2013, 12:43 PM
  2. Replies: 3
    Last Post: 02-03-2012, 06:37 PM
  3. order by dlookup not working
    By broof in forum Queries
    Replies: 3
    Last Post: 01-11-2011, 03:15 PM
  4. DLookup code not working
    By lukekelly in forum Programming
    Replies: 9
    Last Post: 06-15-2010, 06:08 AM
  5. Dlookup??
    By Vikki in forum Access
    Replies: 4
    Last Post: 02-16-2010, 07:59 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