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!

Access Forms

Status
Not open for further replies.

melisc

Programmer
Feb 6, 2004
15
US
I am trying to set up an Access form so that the item selected in the combo box populates the rest of the fields on that form. I want to use it as a lookup box so that when someone selects a Company, the company information will populate in the rest of the fields. Any ideas?
 
why dont u use a subform for the company info link to the main form by the company...

jb
 
Melisc,

This is a commonly done thing. I do it in some applications I build. Put a combo box at the top of your form. Do not bind it to any field in the recordsource of your form. The rowsource for the combo box will be something to the effect of:
SELECT CompanyID, CompanyName FROM tblCompany ORDER BY CompanyName

In the after update event of the combo box, you'll need code to get you to the correct record. Unfortunately, I wrote this code so long ago that I can't remember exactly how I do it in my databases (don't have any of them with me at the moment), but there are plenty of ways. I would think the fastest would be to use the Seek function. Sorry for the partial answer.

Jeremy

==
Jeremy Wallace
AlphaBet City Dataworks
Access Databases for Non-Profit Organizations

Please post in the appropriate forum with a descriptive subject; code and SQL, if referenced; and expected results. See thread181-473997 for more pointers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top