C
Clint Liezert
I am getting frustrated beyond imagination !!
I am using Windows XP and Access 2002
I have a table in my database named "Codes". I can use
the following code:
Dim myDb As Database
Set myDb = CurrentDb
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentData
For Each obj In dbs.AllTables
' Print name of obj.
Debug.Print obj.Name
Next obj
And all of the tables, including "Codes" is listed in
the immediate window. But if I try the following code:
Dim myDb As Database
Set myDb = CurrentDb
Dim rstCodes As Recordset
Set rstCodes = myDb.OpenRecordset(Codes)
The system responds that it can't find the input table
or query. I have changed the syntax everyway I can think
of and the only thing that changes is the error message.
It appears that the system doesn't recognize the table or
it is out of the path or whatever. I have used the same
syntax in other applications in earlier versions of
Access. They work in this version as well but I am
obviously overlooking something. Any help would be
GREATLY appreciated.
I am using Windows XP and Access 2002
I have a table in my database named "Codes". I can use
the following code:
Dim myDb As Database
Set myDb = CurrentDb
Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentData
For Each obj In dbs.AllTables
' Print name of obj.
Debug.Print obj.Name
Next obj
And all of the tables, including "Codes" is listed in
the immediate window. But if I try the following code:
Dim myDb As Database
Set myDb = CurrentDb
Dim rstCodes As Recordset
Set rstCodes = myDb.OpenRecordset(Codes)
The system responds that it can't find the input table
or query. I have changed the syntax everyway I can think
of and the only thing that changes is the error message.
It appears that the system doesn't recognize the table or
it is out of the path or whatever. I have used the same
syntax in other applications in earlier versions of
Access. They work in this version as well but I am
obviously overlooking something. Any help would be
GREATLY appreciated.