dim rs as dao.recrdset
dim strSQL as string
set rs = me.recordsetclone
strSQL = "[Owner Name]= 'Something', [Tenant Name] = 'SomethingElse', [Month Completed] = 'February', [Year Completed] = 2010"
rs.findfirst strSQL
If rs.nomatch = true then
msgbox "No Match Found"
Else
me.bookmark = rs.bookmark
end if
dim rs as dao.recrdset
dim strSQL as string
set rs = me.recordsetclone
strSQL = "[Owner Name]= 'Something' AND [Tenant Name] = 'SomethingElse' AND [Month Completed] = 'February' AND [Year Completed] = 2010"
rs.findfirst strSQL
If rs.nomatch = true then
msgbox "No Match Found"
Else
me.bookmark = rs.bookmark
end if
'opens form, goes to job id, finds the corresponding clicked job id and closes the find form
DoCmd.OpenForm "frmPreviouslyWX", acNormal
'DoCmd.FindRecord
Dim cn As New ADODB.Connection
Set cn = CurrentProject.Connection
Dim rs As New ADODB.Recordset
rs.ActiveConnection = cn
rs.Open "SELECT PreviouslyWeatherized.Owner, PreviouslyWeatherized.Tenant, PreviouslyWeatherized.StreetNumber " & _
"FROM PreviouslyWeatherized " & _
"ORDER BY PreviouslyWeatherized.MonthCompleted;", , adOpenStatic, adLockOptimistic
rs.MoveFirst
Dim ctr As Long
ctr = 1
Dim recordPlace As Long
While Not rs.eof
If IsNull(rs.Fields(1) = Me.lstPrevWX_Results.Column(2)) Then
If rs.Fields(0).Value = Me.lstPrevWX_Results.Column(1) And rs.Fields(2).Value = Me.lstPrevWX_Results.Column(3) Then
recordPlace = ctr
End If
ElseIf rs.Fields(0).Value = Me.lstPrevWX_Results.Column(1) And rs.Fields(1) = Me.lstPrevWX_Results.Column(2) Then
recordPlace = ctr
End If
ctr = ctr + 1
rs.MoveNext
Wend
DoCmd.OpenForm "frmPreviouslyWX", acNormal
DoCmd.GoToRecord acDataForm, "frmPreviouslyWX", acGoTo, recordPlace
DoCmd.Close acForm, "frmFind", acSaveYes
Open in new window
The exact syntax depends on the actual field types, how you are defining the criteria (for example user input from a form, and how you are using the results (such as limiting the records shown in a form or report).