Personalize msgbox if criteria not found

  • Thread starter Thread starter klumzyab
  • Start date Start date
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
 
You can use a macro MsgBox action with a condition that check for the
presence of the parameter.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top