Set combo rowsource on form open event
Unless I’m mistaken you can set a combo box’s rowsource on the openEvent of a form correct? In my combo’s property sheet I specified a type of “Table/query” as well as the number of columns and which one is bound.
And then I placed the below code into my forms onOpen event, but my combo is coming up blank.
I checked in debug mode and the strSql statement is filling properly.
Please advise.
'cboCode must be set once the form opens
Dim strSQL As String
Select Case glblDirCode
Case 1100
'none...5/9/02
Case 1400
strSQL = "SELECT Code,Description FROM Budget WHERE Code = '" & 140160250 & "' Or Code = '" & 140360249 & "'"
End Select
'set cboCode's recordsource...5/9/02
Me.Code.RowSource = strSQL
Unless I’m mistaken you can set a combo box’s rowsource on the openEvent of a form correct? In my combo’s property sheet I specified a type of “Table/query” as well as the number of columns and which one is bound.
And then I placed the below code into my forms onOpen event, but my combo is coming up blank.
I checked in debug mode and the strSql statement is filling properly.
Please advise.
'cboCode must be set once the form opens
Dim strSQL As String
Select Case glblDirCode
Case 1100
'none...5/9/02
Case 1400
strSQL = "SELECT Code,Description FROM Budget WHERE Code = '" & 140160250 & "' Or Code = '" & 140360249 & "'"
End Select
'set cboCode's recordsource...5/9/02
Me.Code.RowSource = strSQL