Query with Dlookup returning wrong value

bennybee

Registered User.
Local time
Today, 13:50
Joined
Jan 13, 2004
Messages
50
Im trying to use the Dlookup value on a form just to display some info for the user.

im using
=DLookUp("Premises_Name","[Meeting_Agenda]","Meeting_Agenda_Number = " & [Meeting_Agenda_Number])

but instead of displaying the premises_name = its actually displaying the premises number (i.e. 16 instead of the name).

in the Meeting_Agenda table, there is a drop down box that has all the premises names, and these come up with the names.
they are referenced to a Premises table via premises_number.

i would have thought that if the value stored in the meeting_agenda table would have been the actual name, rather than the premises number, so that all i had to do was reference to that.

how can i make it so that it displays the prem. name rather than the number?:confused:
 
If 16 is the correct premises number, try nesting a DLookup() function to look up the premises name from the Premises table, using the returned premises number 16 as the criteria e.g.

=DLookup("Premises_Name","Premises","Premises_Number=" & DLookUp("Premises_Name","[Meeting_Agenda]","Meeting_Agenda_Number = " & [Meeting_Agenda_Number]))
 

Users who are viewing this thread

Back
Top Bottom