J
Jonathan Snyder via AccessMonster.com
I have a hot button on my form using the docmd.findrecord. If the record
is not found, I would like to display a message stating so. Here is my
code, but it always displays the not found message even if the record is
found.
Can anyone please help? Thanks
Private Sub CmdFindCert_Click()
On Error GoTo Err_CmdFindCert_Click
Dim cert As String
cert = InputBox("Enter a Certificate Number", "Search")
If cert = "" Then Exit Sub
Me.Certificate_Number.SetFocus
DoCmd.FindRecord cert, acEntire, , acSearchAll, , acCurrent
If Not IsNull(cert) Then
MsgBox "not found"
Else: Exit Sub
End If
Exit_CmdFindCert_Click:
Exit Sub
Err_CmdFindCert_Click:
MsgBox Err.Description
Resume Exit_CmdFindCert_Click
End Sub
is not found, I would like to display a message stating so. Here is my
code, but it always displays the not found message even if the record is
found.
Can anyone please help? Thanks
Private Sub CmdFindCert_Click()
On Error GoTo Err_CmdFindCert_Click
Dim cert As String
cert = InputBox("Enter a Certificate Number", "Search")
If cert = "" Then Exit Sub
Me.Certificate_Number.SetFocus
DoCmd.FindRecord cert, acEntire, , acSearchAll, , acCurrent
If Not IsNull(cert) Then
MsgBox "not found"
Else: Exit Sub
End If
Exit_CmdFindCert_Click:
Exit Sub
Err_CmdFindCert_Click:
MsgBox Err.Description
Resume Exit_CmdFindCert_Click
End Sub