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!

source query of combo box based on contents of another combo box

Status
Not open for further replies.
Jun 10, 2011
17
US
I have a form with 2 combo boxes on it
ComboBox1 hase 3 items: A, B & C
ComboBox2 sourcequery should change based on the answer to ComboBox1

case ComboBox1 = A then ComboBox2 source = query1 4 columns
case ComboBox1 = B then ComboBox2 source = query2 6 columns
case ComboBox1 = C then ComboBox2 source = query3 2 columns

Ideas are appreciated

wrinkle: The return results may have a different number of columns also
 
on the on enter event of combo 2 set the rowsource and any other properties. Use a select case

select case nz(me.combobox1,"")
case "A"
me.combobox2.rowsource = "query1"
'other properties
case "B"
me.combobox2.rowsource = "query2"
'other properties
....
case else
'handle not A,b,c
end select
 
granitetech,
The proper way to say thanks (in addition to replying) is to click the link that states "Thank MajP for this valuable post!"

This also lets us know the thread has been successfully closed.


Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top