parameter will look like:
[Forms]![frmDatePrompt]![txtBegin] ... instead of [Type the beginning
date].
When you create a parameter that looks like this, Access first checks
to
see
if the form you reference is open and that it contains a control with
the
name you specify. If not, it'll prompt you for the value, just like
it
does
now. If it does find the form and control, it won't prompt you at
all.
In the Open event of the report, open this form as a Dialog. Provide
a
command button on the form that runs code to verify the two date
values
and
hide the form (Me.Visible = False) to allow the report to continue.
In
the
Close event of the report, close the form.
--
John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
http://www.deanforamerica.com/site/TR?pg=personal&fr_id=1090&px=1434411
Thank you, that worked. Although the parameter window pops-up on
closure.
Is
this normal?
Now what would be the best way to run a report that has 3 subreports
attached to the main report which all use the same range of dates.
Right
now
I'm getting four parameter windows that I have to put the same range
of
dates. Surely, there is a way that I can get one parameter window
that
will
satisfy all. Thanks so much for your help.
Declaring the parameters is not the same as specifying the values.
You
MUST
declare your parameters ([Type the beginning date], [Type the
ending
date])
in a crosstab. Open the query in design view. Choose Parameters
from
the
query menu. On the first line in the Parameters dialog box, type:
[Type
the
beginning date] and select Date/Time as the data type. Do the
same
thing
for the second parameter on the second line.
--
John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
http://www.deanforamerica.com/site/TR?pg=personal&fr_id=1090&px=1434411
That's the problem. I don't want to declare specific parameters.
How
would
I
use (Between [Type the beginning date] And [Type the ending
date])?
Access
won't accept it in the parameter's grid.
Donna-
You should always explicitly declare parameters in any query,
but
in
a
Crosstab, you *must* declare them. With the query in Design
view,
choose
Parameters from the Query menu.
--
John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
http://www.deanforamerica.com/site/TR?pg=personal&fr_id=1090&px=1434411
How can I query for parameters in a cross-tab query? I need
for
my
users
to
be able to put in a date selection but the jet engine
doesn't
recognize
the
request? Any help would be appreciated.
Thanks,
Donna