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

Combo box form question

Status
Not open for further replies.

todd8

Technical User
Jun 10, 2005
4
US
I have a database containing facility id, facility id, and contact information. I want to use a form that contains two combo boxes that allow a user to select either the facility id or a name, and then based on the selection, would take all of the record data, and populate a separate form.

Any ideas?
 
Hi

Not sure which bit you do not understand

It would be easier to have one combo, with a option group to determine order of cobo list, you would change this in the after update event of the option group

In outline

for FacilityId - combo has rowsource "SELECT FacilityId, FacilityDesc FROM Yourtable ORDER BY FacilityId;", and column widths 1;5 cm

for Description - Combo has rowsource "SELECT FacilityId, FacilityDesc FROM Yourtable ORDER BY FacilityDesc;", and column widths 0;5 cm

remember to requery the combo after you update the properties

second form has recordsource based on query with form1 combo box a criteria, so you are always looking for a FacilityId, even if user chooses by description

Does that explain?

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
If I am understanding this correctly, it sounds like something I do all the time.

Simply create a copy of your first combo box. Right-click it, choose properties. On the "Row Source" of the Data tab, click the build button to expose the underlying query.

Switch the order of the columns. Combo box columns are displayed in the order they occur within the query.

On the Data tab, change the "Bound Column" property to reflect the new position of the field actually supplying the data.

You're done.


The advantage is that your users can type the description in box that displays the description first, or the ID in the box that displays the ID first. This assumes that "AutoExpand" is set to 'yes'.
 
How are ya todd8 . . . . .

Have a look here: How to Synchronize Forms . . . Your Way!

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top