I'm creating combo boxes at run time. I would like to set the data source dynamically like this.
where SomeView is a variable containing the name of the view I want to use. I have the following code but obviously I still have to code the data source manually. Ideally I want the data source name stored in a table I use to create the combo boxes.
Auguy
Sylvania/Toledo Ohio
Code:
Cob1.DataSource = SomeView
Code:
Private Sub setComboBoxDataSource(ByRef cbo1 As ComboBox, ByVal cboNbr As Integer)
Select Case cboNbr
Case 1
cbo1.DataSource = UnitTypeView
Case 2
cbo1.DataSource = MakeView
Case 3
cbo1.DataSource = ModelView
Case 4
cbo1.DataSource = DoorView
End Select
End Sub
Auguy
Sylvania/Toledo Ohio