G
Guest
Help!
I am getting an Error 91 code "Object variable or With
block variable not set"
I get it on
Set rs = CurrentDb.OpenRecordset("qryFirst")
from the following code:
Private Sub cmdSubmit_click()
Dim rs As DAO.Recordset
Dim CurrentDb As Database
Set rs = CurrentDb.OpenRecordset("qryFirst")
rs.MoveLast 'I put this in because I've found
sometimes it doesn't count properly
otherwise...
If rs.RecordCount = 0 Then
MsgBox "blah"
Else
DoCmd.OpenQuery "qryFirst", acViewNormal
End If
End Sub
Any ideas what's causing this error?
I am getting an Error 91 code "Object variable or With
block variable not set"
I get it on
Set rs = CurrentDb.OpenRecordset("qryFirst")
from the following code:
Private Sub cmdSubmit_click()
Dim rs As DAO.Recordset
Dim CurrentDb As Database
Set rs = CurrentDb.OpenRecordset("qryFirst")
rs.MoveLast 'I put this in because I've found
sometimes it doesn't count properly
otherwise...
If rs.RecordCount = 0 Then
MsgBox "blah"
Else
DoCmd.OpenQuery "qryFirst", acViewNormal
End If
End Sub
Any ideas what's causing this error?