Set combo rowsource on form open event

arage

Registered User.
Local time
Today, 20:38
Joined
Dec 30, 2000
Messages
537
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
 
Try "Me.Repaint" after you set the combobox RecordSource.

RichM
 
I just solved part of the problem as I was running an old function before the new SELECT CASE statements I entered. Now I’m working on whittling down that list even more.
 

Users who are viewing this thread

Back
Top Bottom