Linking combo boxes to LIST BOX

  • Thread starter Thread starter Guest
  • Start date Start date
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...
 
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
 
Back
Top