Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How Do I Validate a Query Parameter? 1

Status
Not open for further replies.

ned2

Technical User
May 15, 2001
4
US
I have designed a query that prompts for a month/day date. The format must be in the form MM/DD, where both month and day are 2 digits. I have looked at the query in Design View, and brought up the properties for the field which has the heading for the parameter prompt in square brackets; i.e., [Enter date (MM/DD]. I have created an input mask of the form 00/00;0;n, for this field with format Very Short Date (also Short Date), but it appears to have no effect when I enter the parmeter. The query works fine, but produces incorrect output if the wrong format is entered.
 
Unfortunately, the parameter prompting has no connection to the field you're working with - for example, your field's INPUT MASK of Tiny Date only controls data being posted to the table, and your parameter box isn't POSTING, it's just getting some keyboard input from the user.

Parameter boxes are notoriously bad at formatting data. In your case, I think you'd be better served with a small form, with TWO text boxes, that you can pass to your query as the MONTH() and DAY() of your date guy.

With the text boxes, you can more effectively control data typed in.

78.5% of all statistics are made up on the spot.
Another free Access forum:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top