Access.Application.CurrentDb nothing?
I am at a loss to explain this:
I am getting the error:
Error "91" (object or block is not installed)
on the second line below:
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("SELECT * FROM employees")
This also brings up the following:
`Set rs = CurrentDb.OpenRecordset("employees")`
Executing only ?CurrentDb.Name
in the immediate window also throws an error.
Now obviously the database is open as I am editing the form inside it, so what could be causing this error here?
0
source to share
4 answers
The reason I suspect the code won't work is because, according to M / Soft, the link text 'CurrentDb' is the method that will return "object variable of type Database ". Therefore the code shown by Forester93 should work. Its something that I will use and have been using for many years.
0
source to share