Validating User input gathered in a query

brumshine

Registered User.
Local time
Today, 03:52
Joined
Dec 17, 2008
Messages
37
I am prompting for user input inside of a query like this [Enter a unit number] in the criteria field. This query is being called by a report. I would like to verify that this value is a four digit integer and would like to display an error message and reprompt the user for input if an invalid value is entered. I'm not using any type of form currently and would to avoid doing so if possible.

What I've tried:
1. I attempted to place the [Enter a unit number] inside of an IFF() statement.
2. I attempted to place an if statement inside of the on open section of the calling report.
3. I attempted to place a msgbox() and then set focus in the on text box.

Any suggestions or advice is appreciated greatly.

Thanks,

BRUMSHINE
 
if it's not a four digit integer would that result in no data being returned? if so, you could use the On No Data event to send a message, set cancel=true (report doesn't open) and fire the original event again.
 
Wazz, way to simplify the situation. Your solution worked perfectly. I really appreciate the tip.

Thanks again.

BRUMSHINE
 
glad that worked out.
 

Users who are viewing this thread

Back
Top Bottom