Access.Application.CurrentDb is Nothing?

Posted by Allain Lalonde on Stack Overflow See other posts from Stack Overflow or by Allain Lalonde
Published on 2009-01-06T19:42:38Z Indexed on 2010/03/16 11:56 UTC
Read the original article Hit count: 216

Filed under:
|
|

I'm at a loss to explain this one:

I'm getting an error "91" (Object or With block not set) on the second line below:

Dim rs As DAO.Recordset

Set rs = CurrentDb.OpenRecordset("SELECT * FROM employees")

The following also causes it: Set rs = CurrentDb.OpenRecordset("employees")

Executing ?CurrentDb.Name alone in the immediate window causes the error as well.

Now, clearly the database is open since I'm editing the form within it, so what can cause this error here?

© Stack Overflow or respective owner

Related posts about ms-access

Related posts about error