Using Row source of combo box

  • Thread starter Thread starter Roy Goldhammer
  • Start date Start date
R

Roy Goldhammer

Hello there

I have a continues form with combobox. If one of the fields is 1 the row
source should be "A"
and if the same field is 2 the row source should be "B"

Is there a way to do this?
 
If you need to change this on a record-by-record basis, you can change the
..RowSource of your combo in the Form's Current event:

Sub Form_Current()
If YourField = "1" Then
YourCombo.RowSource = "SomeSQLString"
ElseIf YourField = "2" Then
YourCombo.RowSource = "SomeOtherSQLString"
End If
End Sub

As users navigate through the records on your continuous form, the
..rowsource will be changed ...
 
Back
Top