Message Box Cancel/Retry

Mel Henderson

Registered User.
Local time
Today, 19:52
Joined
Feb 13, 2000
Messages
14
I have a query named UPDATE INVOICE one of the fields is [PLATE NUMBER] I use the following in the criteria for that field, Like [Enter Plate Number]. When I run the query I am prompted to enter a plate number.
I have created a form that is also called UPDATE INVOICE, and use this query as the record source.
I then added a switchboard and used one of the buttons to open my form, if I enter a plate number that is in my data base, I will pull up that record in my form that’s fine but if I enter the wrong plate number I pull up a blank record on my form. I need to bring up a message box that will say “Plate Number is Wrong” and give the user a message box with a Try Again and a Cancel button. If they click on try again they should go back to the [Enter Plate Number window], if they click on Cancel they should go back to the switchboard.
I have tried to use some of the error codes and Dcount codes found on the forum but have had no success. Maybe I was putting it in the wrong place or maybe it was the wrong code for this application.
Thank you for any help you can provide to help with my problem.

Mel
 
Couldn't you use a combo box with a rowsource of the valid platenumbers? That way the user wouldn't be able to enter an incorrect plate number.
 
I did not want to do it that way because they could enter a plate numer that has never been entered before, so the message would tell them plate number is wrong or not on file.

Mel
 
If you use the combobox idea and set the 'Limit to List' property to 'Yes', then you can make use of the 'On Not In List' event to run code that will do whatever you want it to. In your case, you'd get it to run a msgbox asking if the user wants to try again.
 

Users who are viewing this thread

Back
Top Bottom