Need MsgBox

JLAZ

Registered User.
Local time
Today, 06:41
Joined
Sep 17, 2003
Messages
24
I have this code

Private Sub SearchStock_AfterUpdate()

Me.RecordsetClone.FindFirst "SerialNumber = " & SearchStock
Me.Bookmark = Me.RecordsetClone.Bookmark
SearchStock = Null



End Sub

But I need a message box to appear when the user imputs data that is not in the database
 
Try the following code after the findfirst line -

if me.recordsetclone.nomatch then
msgbox "Your error message here"
exit sub
end if

If SearchStock is a string in

Me.RecordsetClone.FindFirst "SerialNumber = " & SearchStock

that lkne should read

Me.RecordsetClone.FindFirst "SerialNumber = '" & SearchStock & "'"
 
Hi llkhoutx

That worked great. I can use all the help I can get VB and SQL are way past my knowledge unfortunately
 

Users who are viewing this thread

Back
Top Bottom