Results 1 to 6 of 6
  1. #1
    justravis is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2013
    Posts
    3

    DLookup?

    My textbook gave me this expression to enter in a text box:
    =DLookup(“[Disclaimer]”,“StandardText”,”[DisclaimerID]=”&1)

    Access 2007 says it's invalid. Do you know where I'm going wrong???



    Thanks!!!

  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,923
    How about: =DLookup(“[Disclaimer]”,“StandardText”,”[DisclaimerID]=1")
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

  3. #3
    justravis is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2013
    Posts
    3
    Quote Originally Posted by RuralGuy View Post
    How about: =DLookup(“[Disclaimer]”,“StandardText”,”[DisclaimerID]=1")
    Thanks RG, but I get the error "You may have entered an operand without a operator."

    Thoughts?

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,429
    Access2000 get a syntax error also.

    The problem is the quote character you used.

    This errors
    =DLookup([Disclaimer],StandardText,[DisclaimerID]=&1)

    This does not error
    =DLookup("[Disclaimer]","StandardText","[DisclaimerID]="&1)

    This does not error
    =DLookup("[Disclaimer]","StandardText","[DisclaimerID]=1")


    Try changing/replacing the quote character.
    HTH
    -----
    Steve
    --------------------------------
    "Veni, Vidi, Velcro"
    (I came; I saw; I stuck around.)

  5. #5
    justravis is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2013
    Posts
    3
    You got it! Thank you so much!

  6. #6
    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,923
    Good catch Steve.
    (RG for short) aka Allan Bunch Previous MS Access MVP - WinXP Pro, Win7 Pro Win10 Pro - acXP, ac07, ac10, ac13
    How to mark the thread as Solved!
    Teaching is not filling a bucket but lighting a fire.
    Borrowed quote..."Docendo discimus"

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

Similar Threads

  1. Like in Dlookup
    By msp4422 in forum Programming
    Replies: 3
    Last Post: 02-19-2013, 04:02 PM
  2. Help with Dlookup
    By taimysho0 in forum Programming
    Replies: 2
    Last Post: 07-07-2012, 03:55 AM
  3. Dlookup
    By cbrsix in forum Forms
    Replies: 2
    Last Post: 11-01-2011, 02:59 PM
  4. Dlookup
    By cbrsix in forum Forms
    Replies: 6
    Last Post: 11-01-2011, 10:38 AM
  5. DLookup help
    By denners05 in forum Access
    Replies: 1
    Last Post: 06-11-2011, 12:55 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