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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date format input to query

Status
Not open for further replies.

button71

Programmer
Nov 8, 2006
69
AU
I am having to maintain an Access application - I am only lightly familiar with Access

There is a form asking for start and finish dates to be input to run a query.

The current format causes the query to open dialogues to key in a date.

By experimentation I find that the format dd mm yy will run the query - eg 12 01 03 this is English format for 12 January 2003.

Can someone help me with the input mask for the two date fields to give me the required input for the query.

Many thanks

William

 
If these are the standard Access dialog boxes prompting for a parameter value I don't believe it is possible to create an input mask. You will need to create your own form.

The input mask you'll want is:

00/00/0000;0;_

or 00/00/00;0;_ (if you want a two digit year).

Also set the format of the control to "Short Date" from the drop down list of otpions.

Ed Metcalfe.

Please do not feed the trolls.....
 
Ed,

Thanks for your suggestion.

I had close to that with the slashes the other way.

However, even though I've used 00/00/00;0;_ I still see the 4 digit year in the date field of my input form.

And I still get the dialogue box to input dates when the query is run from a [Go] button on the input form.

At this point input of 01 02 05 etc or 01 02 2005 is not accepted even though it works when the query itself is run.

So going back to the original query is it possible to 'see' what format is required?

Thanks for your interest

William
 
Further to my previous post if I input 1 Jan 2002 on the query dialogue on the way to the report I get past the problem.

So I need a format to give me that style of date - incidently the form has on it - enter date as 31/12/05

Regards

William

 
Further again - looking at the debug of the code I see the date clearly as 1/02/2002 - so this is the format I'm looking to get form the input form

William.
 
I still get the dialogue box to input dates
In your query replace the actual parameter (eg [start date]) with the full qualified control name, eg:
[Forms]![your main form]![your date control]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top