ONERROR ?

  • Thread starter Thread starter frustrated
  • Start date Start date
F

frustrated

I have a button on a form and when you click it, I want it to open another
form to a certain record. That works just fine, however, when that criteria
doesn't exist, I want to give an error and then allow them to enter new
criteria. This does work to an extent. Even if the criteria exists in the
db, I get the error message and it wants me to enter new criteria. The
set-up of the macro is as follows:
Action Argument
OpenForm frm_Cell_Users, Form, Q_Cell_User_Cell, ,
Edit, Normal
OnError Next,
MsgBox The Cell Phone Number entered does not
exist.
Please try again., Yes, Information,
Not in database
Requery

I am not sure what I am doing wrong. I am fairly new to building macros.
Any help is GREATLY appreciated!
Thanks in advance :)
 
Hi,
yes, it is very frustrating.
The easiest way for the users would be to give them a list of cell phone
numbers in a combo. They would pick the one they want from the list.
You can set up the row source of the combo so that it only shows numbers in
the list that will open the form.
The macro would get its criteria from the number selected in the combo.

Jeanette Cunningham
 
Back
Top