Personalize msgbox if criteria not found

K

klumzyab

Hi, I am using a simple basic criteria to search for a certain number
(parameter is entered) in the database.
I have a form set up that runs on this query and displays the information for
that number, which can be updated.

When the number is not entered correctly, instead of just returning a blank
page on the form/query i want to personalise a message saying something like
'criteria not found, please check number and try again or contact dbase
administrator' how do i do that?

Thanks
 
K

KARL DEWEY

You can use a macro MsgBox action with a condition that check for the
presence of the parameter.
 
F

fredg

Hi, I am using a simple basic criteria to search for a certain number
(parameter is entered) in the database.
I have a form set up that runs on this query and displays the information for
that number, which can be updated.

When the number is not entered correctly, instead of just returning a blank
page on the form/query i want to personalise a message saying something like
'criteria not found, please check number and try again or contact dbase
administrator' how do i do that?

Thanks

If I understand correctly, you have a form, using this query as it's
recordsource.
Code the Form's Open event:
If Me.RecordsetClone.RecordCount = 0 then
MsgBox "Criteria not found ... etc."
Cancel = True
End If

If there ae no records returned, the message will appear. The form
will NOT open.
 
Top