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

populating combo box 1

Status
Not open for further replies.

paulminne

Programmer
Nov 27, 2002
80
AU
Hi All,

How can I populate a combo box with specific items that are linked to a record.

eg. If I select a Client name from another combo box, maybe "Joe Smith", I want to only populate the equipment combo box with the equipment he owns. NOT ALL of the equipment in the Equipment table.

Regards,

- Paul

 
HI

you make the recordsource af the equipment combo box a query, whose criteria is the Client combo box

in the got focus event of the equipment combo box, do a requery (cboEquipment.Requery), so that the content is refreshed to reflect the value of the cboClient combobox

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Hi,

What do you mean when you say to "make the recordsource of the equipment combo box a query". How is this done?

Sorry for seemingly simple question.

Regards,

- Paul
 
Hi

Set the .RowSourceType property of the combo to Table/Query

Set the .RowSource to a query, this can be an existing query, as defined in the database Window Query tab, or if you (left) click in the area to the right of the caption (RowSource), you will seea builder button (ie button with three dots on it), click that, and it will take you into the query builder grid.

Or you can do all this from the ComboBox wizard, by simply saying yoy want the columns of the combo box to come from a table or query, rtaher than typing them in.

Hope that helps
Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top