• Syntax error in Lookup (Access 2000)

    Author
    Topic
    #398183

    Invalid syntax

    In my report i want to lookup the value of Firstname and LastName from the table
    Employees and concatenate them.However i get the error “invalid syntax”

    =DLookUp(“[FirstName]”;”Employees” ” & ” [LastName] “; Employees”

    Can somebody help me ?

    Viewing 2 reply threads
    Author
    Replies
    • #759303

      The DLookup function is as follows:

      =DLookUp(“fieldname”,”Tablename”,”Criteria”)

    • #759304

      The DLookup function is as follows:

      =DLookUp(“fieldname”,”Tablename”,”Criteria”)

    • #759309

      Patt gave you the correct syntax for DLookup, but do you need it here? If FirstName and LastName are part of the record source of the report, you can simply use

      =[FirstName] & ” ” & [LastName]

      If they are not part of the record source, you will have to indicate which record should be looked up. Using DLookup without criteria will return the first name Access happens to find in the table; this is probably not what you want.

    Viewing 2 reply threads
    Reply To: Syntax error in Lookup (Access 2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: