A
Allen Browne
After a FindFirst, test the recorset's NoMatch property:
Dim frm As Form
DoCmd.OpenForm "Prsn"
Set frm = Forms("Prsn")
If Not IsNull(Me!ID) Then
With frm.RecordsetClone
.FindFirst "[ID] = " & me!ID
If .NoMatch Then
MsgBox "Not Found"
Else
frm.Bookmark = .Bookmark
End If
End With
End If
Set frm = Nothing
Note: If "ID" is a Text type field, you need extra quotes:
.FindFirst "[ID] = """ & me!ID & """"
Dim frm As Form
DoCmd.OpenForm "Prsn"
Set frm = Forms("Prsn")
If Not IsNull(Me!ID) Then
With frm.RecordsetClone
.FindFirst "[ID] = " & me!ID
If .NoMatch Then
MsgBox "Not Found"
Else
frm.Bookmark = .Bookmark
End If
End With
End If
Set frm = Nothing
Note: If "ID" is a Text type field, you need extra quotes:
.FindFirst "[ID] = """ & me!ID & """"