Linking combo boxes to LIST BOX

G

Guest

Hi what I would like to do is link 4 combo boxes to a list box.. 2 of the 4
combo boxes are cascading.. and when a combo boxs is not in use I would like
it to be dissabled until upon clickl it will be enabled but the rest of the
text boxes will then be disabled..

Thanks...
 
M

Michel Walsh

Hi,


You can change the RowSource at run time. It is up to you to include, or
not, the various conditions, appropriately:



Private Sub MakeRowSource
Dim strSQL as String
strSQL = "SELECT .... WHERE true "
if(includeComboBox1) then strSQL=strSQL & " AND someFieldName=""" &
me.ComboBox1 & """"
if(includeComboBox2) then ...

...

Me.ListBox.RowSource=strSQL
End Sub


and call that sub in each appropriate event handler.




Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top