• DLookup in Query Problem

    Author
    Topic
    #504054

    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’

    Viewing 0 reply threads
    Author
    Replies
    • #1547390

      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

    Viewing 0 reply threads
    Reply To: DLookup in Query Problem

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

    Your information: