This is my first time creating a combo box.
I have a button that opens a form that contains the combo box. I am trying to load all the table names into the combo box. I am getting a mismatch error when I get to this line
Me!ComboBox1.RowSourceType = "Value List"
Here is entire code for this form
Private Sub UserForm_Activate()
Dim tblNames As String
tblNames = " "
Dim tbl As AccessObject
For Each tbl In CurrentData.AllTables
If Right(tbl.name, 10) = "Comparison" Then
tblNames = tblNames & Chr(34) & tbl.name & Chr(34) & ";"
End If
Next tbl
Me!ComboBox1.RowSourceType = "Value List"
Me!ComboBox1.RowSource = tblNames
Me!ComboBox1.Value = Me!ComboBox1.ItemData(0)
Me!ComboBox1.LimitList = True
End Sub
I have a button that opens a form that contains the combo box. I am trying to load all the table names into the combo box. I am getting a mismatch error when I get to this line
Me!ComboBox1.RowSourceType = "Value List"
Here is entire code for this form
Private Sub UserForm_Activate()
Dim tblNames As String
tblNames = " "
Dim tbl As AccessObject
For Each tbl In CurrentData.AllTables
If Right(tbl.name, 10) = "Comparison" Then
tblNames = tblNames & Chr(34) & tbl.name & Chr(34) & ";"
End If
Next tbl
Me!ComboBox1.RowSourceType = "Value List"
Me!ComboBox1.RowSource = tblNames
Me!ComboBox1.Value = Me!ComboBox1.ItemData(0)
Me!ComboBox1.LimitList = True
End Sub