Query to Text box

Ringers

Registered User.
Local time
Today, 15:32
Joined
Mar 4, 2003
Messages
54
I have written a query that works, it's output is a contact name. I am trying to have two combo boxes define the contact name.

combo 1 branch_name
combo 2 branch_city
text box branch_contact

The user makes a selection in each combo box so the contact name will then appear in the text field. But it seems you can't link a text field to a query. How do you get around this? apprently you can use DLOOKUP or DCOUNT, but i can't seem to relate what is in the help field to my problem.

So in other words how do i update the text field from the selection made in the combo boxes?

Any help would be much appreicated.:D
 
Set the controlsource of the textbox to
=Dlookup("[branch_contact]","tblBranches","[branch_city] = " & Forms!NameOfForm!NameofCityCombo & " AND [branch_name] = " & Forms!NameOfForm!NameofBranchCombo

(DLookup Syntax - DLookup("[Field Name]","Table Name","[Field Name to Filter On] = " & FilterVariable/Form Control)

hth
 

Users who are viewing this thread

Back
Top Bottom