how to create an alert if no result found by Form.RecordSource

tinycasher

New member
Local time
Tomorrow, 00:01
Joined
Aug 19, 2011
Messages
2
Hello,

I create a form with the data from multiple tables, and I create an search form which allow me to search by single value (product ref.)

Form_frmdisplay.RecordSource = "SELECT * FROM TableProduct...

I want to create a Msgbox when I input value which is not in my TableProduct, showing "Product not found"

I tried:
If IsNull(Form_frmdisplay.RecordSource) Then
MsgBox "wrong."
End If
But it doesn't work like this?
Could someone help me?

Many thanks.
Theo
 
Hi.. ;)

Try this..:

Code:
if recordsetclone.recordcount =0 then msgbox "Product not found"
 
Hi Taruz,

Many thanks for your help,

It does work now:)
:p

Great site to find help for ACCESS here:)

Hi.. ;)

Try this..:

Code:
if recordsetclone.recordcount =0 then msgbox "Product not found"
 

Users who are viewing this thread

Back
Top Bottom