I am trying to create a listing of tables to use in a list box. I found this code and I am trying to use it to create the value list for the listbox.
When I open the form I get the error; "Runtime error 424 object required"
When I debug it highlights this line of code; For Each objAO In opbCP.AllTables
Any ideas on what I'm doing wrong?
Thanks in advance.
Code:
Private Sub Form_Load()
Dim objAO As AccessObject
Dim objCP As Object
Dim strValues As String
Set opjCP = Application.CurrentProject
For Each objAO In opbCP.AllTables
strValues = strValues & objAO.Name & ";"
Next objAO
AllTables.RowSourceType = "Value List"
AllTables.RowSource = strValues
End Sub
When I open the form I get the error; "Runtime error 424 object required"
When I debug it highlights this line of code; For Each objAO In opbCP.AllTables
Any ideas on what I'm doing wrong?
Thanks in advance.