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!

Limiting Choices in a Combo Box

Status
Not open for further replies.

dannyocean

Technical User
Jan 26, 2001
136
US
Hi All,

I am trying to limit the choices in a combo box based upon the answer in a previous field.

Ex. if [Product] = Medicare, then [market] choices are SA or CC or KC or IL.

TIA,

Danny

 
You should have your records in a table.
Supposing you have a table myTABLE with the 2 fields [Products] and [Market].
You just have to :
- parameter your first combo like that
drpPRODUCT.Rowsource = "SELECT PRODUCT FROM myTABLE"

-and add this code into the drpMARKET_Click event
Private Sub drpMARKET_Click()
drpMARKET.Rowsource = "SELECT DISTINCT [MARKET] FROM myTABLE WHERE PRODUCT ='" & drpPRODUCT.value & "'"
End Sub [color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top