Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fill text box with result of query

Status
Not open for further replies.

lesp1

Technical User
Feb 18, 2002
15
GB
I have a form and want to display a value in a text box that depends on the value selected in a combobox.
This value can be found from a query, using the combobox entry.
Can anyone advise me on how to do this?

Cheers

Les P
 
This should work if the Query returns 1 record as the Result:
Me!TheControlName = DLookup("[QueryFieldName]", "TheQueryName")


Or this is how to set a Criteria if necessary on the Result:
Me!TheControlName = DLookup("[QueryFieldName]", "TheQueryName", "[QueryFieldName] = " & Me!ComboBoxName)


Bill


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top