can't open recordset in form code

  • Thread starter Thread starter Fred Parkinson
  • Start date Start date
F

Fred Parkinson

For some reason, after creating a blank (ie new)
database, I can't open a recordset behind a form!

each of the following attempts results in "Object or with
block variable not set" when the 'set' command attempts
to run.

sample code:
1.
strSQL = "tNamesAndEmail"
Set rsList = CurrentDb.OpenRecordset(strSQL, dbOpenTable)
or 2.
strSQL = "SELECT tNamesAndEmail.* FROM tNamesAndEmail;"
Set rsList = CurrentDb.OpenRecordset(strSQL,
dbOpenDynaset)

Theres are no "MISSING" references under Tools>References

What am I missing?
I have been doing this successfully for 4 years, what am
I suddenly doing wrong?

Thank you for your help.
Fred Parkinson
 
Hi Fred

I suspect you have a reference set for ADO (ActiveX Data Objects) not for
DAO. Uncheck the reference to ADO and find "Microsoft DAO 3.x Object
Library" and check that instead.
 
Back
Top