I am trying to move to the first record in a form where a value is false. The underlying form uses a query as it's record source. I am getting an "invalid argument" error where indicated below in code:
Not much hair left, been at this for hours and have been through many threads but can't for the life of me figure this out. I ultimately would like this to run when the form opens but for testing I have it on a button.
Thanks for your help!
Code:
Dim intCountMissing As Integer
Dim strCriteria As String
'check for incomplete (not finalized) surveys on startup
intCountMissing = Nz(DLookup("[RspnsID]", "tblSrvRspns", "[SurveyComplete] = " & False))
If intCountMissing > 0 Then
Select Case MsgBox("You have surveys that are not yet finalized." _
& vbCrLf & "" _
& vbCrLf & "Ok to open the first unfinished survey" _
& vbCrLf & "Cancel to disregard" _
, vbOKCancel Or vbQuestion Or vbDefaultButton1, "Survey Check")
Case vbOK
strCriteria = intCountMissing
MsgBox strCriteria
With Me.RecordsetClone
.FindFirst strCriteria <<< INVALID ARGUMENT
If Not .NoMatch Then
Me.Bookmark = .Bookmark
End If
End With
Case vbCancel
End Select
End If
Thanks for your help!
Comment