Set up mask on parameter value

G

Guest

Hi all,

I have a query when you run it then it will pop up a little screen asking to
enter begining date and ending date. I was wondering if I can set a mask on
the parameter value so that I do not have to remember what is the date
format. I was able to set the mask on the table but the format does not apply
to the query.

Thank you,
John
 
N

Nick 'The database Guy'

Hi Jon,

Not sure if you can do what you are asking, however there is nothing
stoping you making a form which is open when the report runs and asks
for startdate and enddate, presumably these would have input masks and
the button to run report only becomes enabled once they have been
filled in. Also this would be better as the whole date would not have
to be typed each time and you could set defaults.

Good luck,

Nick
 
J

John Spencer

You can add a note to the parameter suggesting the format, you can't enforce
it.
[Begin Date: (mm/dd/yyyy)]

That will display Begin Date: (mm/dd/yyyy) as the prompt.

You really need a form as the parameter source.

Check out this article for a detailed discussion.
http://www.fontstuff.com/access/acctut08.htm


A brief quote from an John Vinson (Access MVP) posting.

You'll need to create a small unbound Form (let's call it frmCriteria) with
a Combo Box control (cboCrit) on it. Use the combo box wizard to select the
table for the selections, and be
sure that the bound field of the combo is the value you want to use as a
criterion. Save this form.

Now use

=[Forms]![frmCriteria]![cboCrit]

as the criterion in your Query.

It's convenient to base a second Form or Report on the resulting query to
display the results; if you put a button on frmCriteria to launch that form
or report, the user can enter the criterion and view the results in one
simple operation!

Quoting John Vinson

Keywords: Parameter Queries
 
K

Khartoum

ok thanks

Nick 'The database Guy' said:
Hi Jon,

Not sure if you can do what you are asking, however there is nothing
stoping you making a form which is open when the report runs and asks
for startdate and enddate, presumably these would have input masks and
the button to run report only becomes enabled once they have been
filled in. Also this would be better as the whole date would not have
to be typed each time and you could set defaults.

Good luck,

Nick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top