Type mismatch error on OpenRecordset

  • Thread starter Thread starter Jean Fletcher
  • Start date Start date
J

Jean Fletcher

Guest
On this command:
dim rs as Recordset
rs = currentdb.openRecordse("Table Name") I get a 'type mismatch' error. Why.
(I am new to Access programming)
 
You need to type this:

Set rs = currentdb.openRecordse("Table Name")

Anytime you're setting the value of a variable to an object you have to put set in front.
 
type mismatch

I have 'set rs=currentdb.openRecordSet("Table Name"). I still get the error.
 
Is there spaces in the name of the table? If so you'll need to contain the name in brackets as well.
 
type mismatch

Thank you for answering. I am new at this.
The actual table name is AceReportTable. However I can try putting the brackets around it.
 
If you are using 2000 or newer then try dim rs as DAO.recordset
 

Users who are viewing this thread

Back
Top Bottom