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!

List Boxes Updating Based Upon Selection from a Previous List Box

Status
Not open for further replies.

1970013

IS-IT--Management
Mar 11, 2002
16
US
I have a form that I want the to have the choices in my second box to show only the choices that are applicable to my selection in the first list box. Can this be done fairly easily? How do I go about doing it? Thank you in advance.


Heath Boroff
 
This is very easy. Do the following:

2nd cboBox should have the criteria set to the 1st box.

e.g. cboBox2.datasource = Select name, state from table1
where state = forms!frmActive!cboBox1

Then on the AfterUpdate event of the 1st combo box type:
me.cboBox2.requery
 
I am sorry but I am kind of new to the whole access thing. When you say criteria set, I am looking through my options in the second combo box and I do not see anything about criteria set. Could you point me in the right direction?

Thank you.

Heath
 
Go to the Rowsource property of the combo box. Click on the Ellipse button [...], it should bring up a query view. Under the column that you want to match (e.g. state in my last example) there is an area for criteria. You can either build (right click in criteria and click Build) or just type:
Forms!(your form name)!(the 1st combo box name)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top