I have found some code to create a dynamic list of tables in Access on a form, but I keep getting error #438 "object doesn't support this property or method". Do I need to add a reference from the reference library? If so, which one?
Here's the code in case it helps.
Private Sub Form_Current()
Dim objAO As AccessObject
Dim objCP As Object
Dim strValues As String
Set objCP = Application.CurrentProject
For Each objAO In objCP.AllTables
strValues = strValues & objAO.Name & ";"
Next objAO
'Set combo box row source to strValues
cboTableListImport.RowSource = strValues
End Sub
Thanks for any feedback!!!
Here's the code in case it helps.
Private Sub Form_Current()
Dim objAO As AccessObject
Dim objCP As Object
Dim strValues As String
Set objCP = Application.CurrentProject
For Each objAO In objCP.AllTables
strValues = strValues & objAO.Name & ";"
Next objAO
'Set combo box row source to strValues
cboTableListImport.RowSource = strValues
End Sub
Thanks for any feedback!!!