Kicking off users

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I get a user defined not defined error message while running this code
and my debugger turns this yellow Dim db As DAO.Database
Please Help
Function fGetOut() As Integer
Dim RetVal As Integer
Dim db As DAO.Database
Dim rst As Recordset
On Error GoTo Err_fGGO
Set db = DBEngine.Workspaces(0).Databases(0)
Set rst = db.OpenRecordset("KickEmOff", dbOpenSnapshot)
If rst.EOF And rst.BOF Then
RetVal = True
GoTo Exit_fGGO
Else
If rst!GetOut = True Then
'This is where you close down any forms, and quit the database
'I leave this section as an exercise in creativity
Application.Quit
Else
RetVal = True
End If
End If
Exit_fGGO:
fGetOut = RetVal
Exit Function
Err_fGGO:
'Note lack of message box on error
Resume Next
End Function
 
in message:
I get a user defined not defined error message while running this code
and my debugger turns this yellow Dim db As DAO.Database
Please Help

<code snipped>

Database is a DAO object, it does not exist in ADO. It sounds like you need to set a reference to
the DAO object library if you are using Access 2000 or 2002. Those versions do not by default set a
reference to the DAO library.

To fix the References problem follow these steps:
- Open any module in Design view.
- On the Tools menu, click References.
- Scroll down to you get to Microsoft DAO 3.xx and check it.
- If you're using Access 97 that should be DAO 3.51 Object Library.
- If you're using Access 2000, 2002, or 2003 that should be DAO 3.6 Object Library.
- Close the References box again.
- Now re-compile again. Debug--Compile.
- Hopefully you should not see any more compile errors.
 
Back
Top