can't find the table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a program that simply does checks on records in a table and the
reports its findings. Unfortunatly I can't get started because I get runtime
error 3078 saying the jet engine can't find the table. I have tried several
tables just to check but I get the same error no matter wat table I pick.
What am I doing wrong? I am using the following code.

Dim db as Database
Dim rec as Recordset

set db = currentDb()
set rec = db.OpenRecordset(Car)

The error always happens when trying to run the last line of the above code.
 
If the name of the table is Car, you need to enclose it in quotes:

set rec = db.OpenRecordset("Car")

Also, to avoid possible ambiguity in your code (the Recordset object exists
in more than one library), you should use:

Dim db as DAO.Database
Dim rec as DAO.Recordset


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Keith said:
I have a program that simply does checks on records in a table and the
reports its findings. Unfortunatly I can't get started because I get runtime
error 3078 saying the jet engine can't find the table. I have tried several
tables just to check but I get the same error no matter wat table I pick.
What am I doing wrong? I am using the following code.

Dim db as Database
Dim rec as Recordset

set db = currentDb()
set rec = db.OpenRecordset(Car)

The error always happens when trying to run the last line of the above
code.
 
Back
Top