Results 1 to 2 of 2
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DLookup in Query Problem

    Having a problem with following DLookup in Query, I've tried the following three variations without success, please help with proper Query/DLookup syntax


    Union Status is a text field in the query


    Union Desc: DLookUp("[Description]","[Union Statuses]","[Code]= [Union Status]")
    Error: The expression you entered as a query parameter produced the error: 'Microsoft Access can't find the name 'Union Status' you entered in the expression'


    Union Desc: DLookUp("[Description]","[Union Statuses]","[Code]= Union Status")
    Error: Syntax error(missing operator) in query expression '[Code]= Union Status'.


    US: Union Status is a text field in the query


    Union Desc: DLookUp("[Description]","[Union Statuses]","[Code]= US")
    Error: The expression you entered as a query parameter produced the error: 'Microsoft Access can't find the name 'Union Status' you entered in the expression'

  2. #2
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,878
    Thanks
    0
    Thanked 0 Times in 0 Posts
    doctor9, UtterAccess Editor, provided the following solution:

    Try this:

    Union Desc: DLookUp("[Description]","[Union Statuses]","[Code]='" & [Union Status] & "'")

    If your [Code] or [Union Statuses] field values can contain apostrophes we'll need a slight variation.

    Hope this helps,

    Dennis

Tags for this Thread

Posting Permissions

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