Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

display message when can't find the searching result

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
hi, again

i got some coding here which is using for searhing the case number ( primary key in my db). i suppose to put several line of code which can display message when can't find searhing number. help!!
thanks.
Private Sub GoBtn_Click()
Dim CaseNum As String
Dim digit As String

If IsNull(Forms!frmCases_pages!FindCaseNo) Then
DoCmd.CancelEvent
MsgBox "You Have Not Entered a Case Number!", [vbOKOnly]
DoCmd.GoToControl ("FindCaseNo")
Exit Sub
Else

DoCmd.GoToControl ("Case_number")
DoCmd.FindRecord CaseNum, , True, , True

End If
 
It depends on how it reacts to finding no record meeting the criteria. Help doesn't explain that situation (not surprising). It probably returns an error, in which case you can use an error handler to handle no match.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top