Results 1 to 4 of 4
  1. #1
    nkenney is offline Advanced Beginner
    Windows 2K Access 2007
    Join Date
    Mar 2009
    Posts
    40

    Dlookup question

    Hello,



    I am having a problem populating a unbound field (Year). I have a field named tag. Based upon the tag field I want to populate the unbound field Year. In my instanct Tag = 303KIE03 and year = 2002.

    I have created the following dlookup statement:
    Year = DLookup("[Year ]", "Vehicle", "[Tag ] = " & Me!Tag)

    I get the following error:
    Run-time error '3075'
    Syntax error (missing operator) in query expression 'Tag = 303KIE03'.

    I know I need to get single quotes around 303KIE03 but all of the combinations I use are invalid. Can you please provide the correct one.

    Thanks,

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Year = DLookup("[Year ]", "Vehicle", "[Tag ] = '" & Me!Tag & "'")

  3. #3
    nkenney is offline Advanced Beginner
    Windows 2K Access 2007
    Join Date
    Mar 2009
    Posts
    40

    Thanks you it worked like a champ!



    Thanks!

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    You're welcome. Are we ready for the Solved thread tool yet?

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

Similar Threads

  1. Dlookup
    By janjan_376 in forum Access
    Replies: 20
    Last Post: 07-07-2009, 07:40 AM
  2. # added to string with Dlookup
    By normever in forum Programming
    Replies: 1
    Last Post: 02-27-2009, 10:52 AM
  3. replacing dlookup fields with variables
    By msupitar in forum Access
    Replies: 0
    Last Post: 02-18-2009, 12:26 AM
  4. Replies: 1
    Last Post: 01-10-2006, 12:32 PM
  5. Need Help for Dlookup function
    By wasim_sono in forum Programming
    Replies: 5
    Last Post: 01-04-2006, 08:18 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