Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Nov 2001
    Posts
    192
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DLookup error (Access 2000)

    Syntax error in DLookup


    I have a table called Affiliates, and want to lookup the city depending on the field afid which is autonumber in the table.This field afid is available also on the report called Invoice.I want the following.If the control afid on the report is 1, then to look up for the city in the table Affiliates,where afid = 1.
    If afid is 2, then to look up for the cisty where afid = 2

    I have placed the following in the control on the report:

    DLookup("[City]", "Affiliates", " Me! [afid] = " & 1)
    However i receive the following error :

    runtime error 3075, Syntax error (missing operator) in query expression
    I have also tried the following
    DLookup("City","Affiliates",afid=1)

    But again without success.

    May i have some further help?

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: DLookup error (Access 2000)

    Hi,
    I think you want this:
    DLookup("[City]", "Affiliates", "[afid] = " & Me!afid)
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •