edit mask on a query prompt

  • Thread starter George Applegate
  • Start date
G

George Applegate

I have a query where I want prompt the user for "enter start date" and
then "enter end date".

I would like to somehow have a mask when they do that so that it makes
the value they enter as 01/02/2008 if they enter 01022008; and if they
would enter 01312008 it would make the end date 01/31/2008. Can this
be done, and if so how do I do that?

What I enter for the prompt has to return with the slashes, but I'd
like to make it easy for them to enter it as mmddyyyy instead of
entering mm/dd/yyyy. Any suggestions?

thanks,
ga

George Applegate
(e-mail address removed)
 
K

Klatuu

You can't do that with an Input Box. You will have to use a form with a text
box to enter the date. You can then put an Input Mask on the text box to
control the slashes.
 
G

George Applegate

I will buy that. It makes sense. So tell me, if I prompt for say
four fields on a form, how do I pass those into a query??? I assume I
can do that somehow??? I want them to become part of the SQL as
"selection" criteria....

Got any references where I can look to see how that can be done?

Thanks!
ga

Klatuu said:
You can't do that with an Input Box. You will have to use a form with a text
box to enter the date. You can then put an Input Mask on the text box to
control the slashes.

George Applegate
(e-mail address removed)
 
K

Klatuu

In the query builder, but the fully qualified reference to the form control
on the criteria row under the field you want to filter:
Forms!MyFormName!MyControlName
 
J

John Spencer

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

Or check out this from MS
http://office.microsoft.com/en-us/access/HA011730581033.aspx

Or for another example
http://allenbrowne.com/ser-62.html


A brief quote from a 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!

End quote

John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
 

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

Similar Threads


Top