I
Ingo Hanke
Dear,
I have a form where I have to populate different combo boxes at
different stages with data from a separate database.
I’m trying to write a Function that would easily repeat the task, the
main problem is specifying what combo box to use. This is what I
think it should look like.
Public Sub LoadCB(cbName As Control, SelectionString As String)
cbCount = 0
Set rstLoadCB = VMSDatabase.OpenRecordset(SelectionString)
With rstLoadCB
For each X in rstLoadCB
cbName.AddItem (current record)
Next
End If
end With
End Sub
I’m not having any luck with all my variations of the code, could
someone please help me
Regards Ingo
I have a form where I have to populate different combo boxes at
different stages with data from a separate database.
I’m trying to write a Function that would easily repeat the task, the
main problem is specifying what combo box to use. This is what I
think it should look like.
Public Sub LoadCB(cbName As Control, SelectionString As String)
cbCount = 0
Set rstLoadCB = VMSDatabase.OpenRecordset(SelectionString)
With rstLoadCB
For each X in rstLoadCB
cbName.AddItem (current record)
Next
End If
end With
End Sub
I’m not having any luck with all my variations of the code, could
someone please help me
Regards Ingo