Dlook Up against a query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NigelBrown
    New Member
    • Oct 2009
    • 34

    Dlook Up against a query

    Hi all,

    I have the below code but cannot get it to work, missing operator ?
    [Code=vb]
    GroupOwner1 = DLookup("GroupO wner", "tbl_GroupOwner s_Master", "Group Mapping = ???")
    [/Code]

    the problem I have is where I have the ????, I want this to refer to a column in a query called GroupMapping, is this possible. I want to open the query and call the function which in turn looks at the data in GroupMapping and returns the group owner from the tbl_GroupOwners _Master ? Any help will be greatly appreciated

    Thanks
    Nigel
  • NigelBrown
    New Member
    • Oct 2009
    • 34

    #2
    Actually all,

    I have written the beow in a select query but it errors, banging my head against the wall, does anyone have any ideas please ?

    GroupOwner: DLookUp("[GroupOwner]","[tbl_GroupOwners _Master]","[Group Mapping] =" & Nz([GroupMapping],0))

    I have two tables in my select query "table A that contains [GroupMapping] and tbl_GroupOwners _Master.

    Thanks
    Nigel

    Comment

    • nico5038
      Recognized Expert Specialist
      • Nov 2006
      • 3080

      #3
      The only problem I can see is when the [GroupMapping] is a text field. The code for that would be:
      Code:
      DLookUp("[GroupOwner]","[tbl_GroupOwners_Master]","[Group Mapping] ='" & Nz([GroupMapping],0) & "'" )
      as it requires surroundung quotes.

      Nic;o)

      Comment

      Working...