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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query Results

Status
Not open for further replies.

FoxStudent

Technical User
Feb 24, 2000
85
GB
I want to on selecting a value froma combo fill in several textboxes. For example, if I selecft a phone number I want to fill in a name text box etc. I have wrote a query that I know works to find the correct name for the phone number selected in he combo I just do not know how to put the result into a text box.
Thank u
 
FoxStudent,

You need to set the data source of your text boxes to something like:

=dlookup("[Name]","[tableName]","[PhoneNo]=[forms]![formName]!comboPhone.value")

Then you'll need to requery your text boxes in the on change event of the combo.

HTH
pjm
 
In the AfterUpdate event of the combo box you can place code to fill them in like this:

MyTextBox = DLookup("[Customer]","MyQuery","[PhoneNbr]=[cboPhoneNbr]")

That's one way to do it. Another is if you put the customer data in the drop down, IE; you have the Customer, Address, etc.. showing when you select the dropdown. You can set the textboxes equal to the column in the combo containing the appropriate data by using the AfterUpdate event.

MyTextBox = cboPhoneNbr.Column(1)

HTH

Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top