P
phobos
Hi,
Here is the code:
Option Compare Database
Sub exaObjectVar()
Dim dbLib As DATABASE
Dim rsPeople As Recordset
Set dbLib = CurrentDb
Set rsPeople = dbLib.OpenRecordset("People")
MsgBox "People record count: " & rsPeople.RecordCount
End Sub
When I try to compile it I get the following error message:
Compile error: User-defined type not defined
The offending line is "Dim dbLib As DATABASE" but I don't get it, because
the way I see it dbLib gets defined on the "Set dbLib = CurrentDb" line.
This code is a module in a database called db1, which has one table called
People. I suspect its something quite simple, but I'm very new to Access
and VB and any help would be appreciated. I'm using Access 2000.
TIA
Here is the code:
Option Compare Database
Sub exaObjectVar()
Dim dbLib As DATABASE
Dim rsPeople As Recordset
Set dbLib = CurrentDb
Set rsPeople = dbLib.OpenRecordset("People")
MsgBox "People record count: " & rsPeople.RecordCount
End Sub
When I try to compile it I get the following error message:
Compile error: User-defined type not defined
The offending line is "Dim dbLib As DATABASE" but I don't get it, because
the way I see it dbLib gets defined on the "Set dbLib = CurrentDb" line.
This code is a module in a database called db1, which has one table called
People. I suspect its something quite simple, but I'm very new to Access
and VB and any help would be appreciated. I'm using Access 2000.
TIA