Results 1 to 3 of 3
  1. #1
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451

    DLookup help

    i have two unbound text boxes. the first uses a module to pull the users log in name called txtname. the second txtlocid,i would like to compare that name to the table 2lognameT and display the location ID where txtname is equal to Dsid. i have

    Code:
    txtLocID = DLookup("[locationid]", "2lognamet", "me.txtname=" & DsID)
    when i step thru it i'm getting a error 3075 for syntax error (missing operator) in query expression 'me.txtname=' . any ideals?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    Is DsId a number or text? If Text, try

    txtLocID = DLookup("[locationid]", "2lognamet", "DsID = '" & me.txtname &"'")

  3. #3
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    thanks orange, that did it. i figured it had something to do with the text but all my combinations were not working. i'll add that one to the library.

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

Similar Threads

  1. Dlookup
    By emanual4real in forum Forms
    Replies: 3
    Last Post: 06-19-2013, 03:09 PM
  2. Need help with a DLookup using Or
    By jax1000rr in forum Queries
    Replies: 1
    Last Post: 05-06-2013, 11:18 AM
  3. dlookup
    By ali zaib in forum Access
    Replies: 3
    Last Post: 01-13-2012, 11:57 AM
  4. DLookUp Help
    By ThaGreenMoose in forum Forms
    Replies: 10
    Last Post: 06-15-2011, 12:08 PM
  5. May it is Dlookup
    By cap.zadi in forum Programming
    Replies: 3
    Last Post: 05-09-2011, 05:58 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