can't open recordset in form code

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
 
G

Graham Mandeno

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top