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

    Syntax error in Lookup (Access 2000)

    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 ?

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: Syntax error in Lookup (Access 2000)

    The DLookup function is as follows:

    =DLookUp("fieldname","Tablename","Criteria")

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Syntax error in Lookup (Access 2000)

    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.

Posting Permissions

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