Results 1 to 4 of 4
  1. #1
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839

    Dlookup Assistance

    Query = qryNetbase
    Controls:
    Netbase
    [TOE Title]
    [Equip HB Name]

    Query2
    Base: DLookUp("[Netbase]","[qrylNetBase]","TOE Title = " & [TOE Title] & " And [Equip HB Name] Like '*TCN'")



    I get a syntax error (missing Operator) in query expression 'TOE Title = 1-1 CAV SQDN And [Equip HB Name] Like '*TCN''

    I am wanting to compare each records netbase where [Equip HB Name] has the Initials TCN in it. Then if not I can change the Netbase to the correct on for that TOE Title.

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    The first problem is that text fields must be surrounded by quotes : "TOE Title = '" (single then double) & [TOE Title] & "' (double then single)

    It might be easier to use the criteria line (if this is a query).

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Also, because there are spaces in field names, brackets are required:
    Code:
    Base:  DLookUp("[Netbase]","[qrylNetBase]","[TOE Title] = '" & [TOE Title] & "' And [Equip HB Name] Like '*TCN'")
    Should NEVER use spaces in object names! (field, table, query, form report or Module)

  4. #4
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    Thanks All it seemed to work w/out errors, but all i get out of it is a blank field. ??

    I didn't know about the ' as I hadn't used them before in a previous Dlookup with the same style. I also didn't know the [] were needed as the field was in "".

    The fields with the spaces in the name are not of my making, but an imported spreadsheet from another database.

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

Similar Threads

  1. Newbie in need of assistance
    By rodcoil in forum Queries
    Replies: 1
    Last Post: 03-06-2015, 04:28 PM
  2. VBA assistance
    By Kwbrown in forum Programming
    Replies: 3
    Last Post: 03-15-2014, 03:09 PM
  3. Qry Assistance Please
    By buck in forum Access
    Replies: 8
    Last Post: 12-31-2013, 08:52 AM
  4. Loop Assistance
    By MegA248 in forum Forms
    Replies: 7
    Last Post: 05-01-2013, 12:24 PM
  5. dlookup assistance
    By underscore in forum Access
    Replies: 4
    Last Post: 12-28-2011, 06:32 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