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!

Lookup fields from another table based "afterupdate" from a combo box

Status
Not open for further replies.

allenEd

Technical User
Nov 14, 2002
129
GB
Hi,



Best explained as the example. Say I have two tables tblContacts and tblServices. In the tblContacts, there are the fields lastname, firstname, address1, address2

In the tblServices there is a lookup to the field "lastname" in the tblContacts table. In a form with recordset tblServices, there is a combo box for the "lastname" field. How do I get a textbox to display the firstname based on the combo box (lastname)?

thanks
Allen
 
What happens if you have two or more contacts with the same last name?

Generically, your combo box can have 1 or more columns. To display the second column from a combo box in a text box, use a control source of:
[tt][red]=cboLastName.Column(1)[/red][/tt]


Duane
Hook'D on Access
MS Access MVP
 
Thanks Duane,

thats really simple! The db was just an example, the "surname" wont be the same. I just wanted to know how you do it.

cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top