B
Bruce
I am using an unbound form (frmSpecify) to specify report
(rptTraining) criteria. Among its controls are text boxes
for Start Date (txtStartDate) and End Date (txtEndDate).
A parameter query (qrySpecify) is the source for
rptTraining. It is based on tblTraining, which includes a
field for [SessionDate]. The parameter for [SessionDate]
is: Between [Forms]![frmSpecify]![txtStartDate] And
[Forms]![frmSpecify]![txtEndDate].
There are other parameters such as EmployeeName, and the
option of leaving parameters blank. The default value for
txtEndDate on frmSpecify is: =Date(). The format for the
text box is Short Date. I would like the default value
for txtStartDate to be January 1 of the current year, but
I am not having any success with formatting the date (e.g.
=Format(Date(),"yy"). The idea was to return two digits
for the current year, and concatenate it with "1/1/".
Another thing I would like to do in a similar situation
elsewhere is to leave txtStartDate blank in order to
return all records. I realize I would have to specify
that in the parameter query. For Employee I can do
something like:
[Forms]![frmSpecify]![txtName] Or [Forms]!
[frmSpecifyRecord]![txtName] Is Null
(no line break) but I cannot figure out how to do that
with Between...And. I will never need to specify that
[txtEndDate] Is Null, since it defaults to the current
date.
(rptTraining) criteria. Among its controls are text boxes
for Start Date (txtStartDate) and End Date (txtEndDate).
A parameter query (qrySpecify) is the source for
rptTraining. It is based on tblTraining, which includes a
field for [SessionDate]. The parameter for [SessionDate]
is: Between [Forms]![frmSpecify]![txtStartDate] And
[Forms]![frmSpecify]![txtEndDate].
There are other parameters such as EmployeeName, and the
option of leaving parameters blank. The default value for
txtEndDate on frmSpecify is: =Date(). The format for the
text box is Short Date. I would like the default value
for txtStartDate to be January 1 of the current year, but
I am not having any success with formatting the date (e.g.
=Format(Date(),"yy"). The idea was to return two digits
for the current year, and concatenate it with "1/1/".
Another thing I would like to do in a similar situation
elsewhere is to leave txtStartDate blank in order to
return all records. I realize I would have to specify
that in the parameter query. For Employee I can do
something like:
[Forms]![frmSpecify]![txtName] Or [Forms]!
[frmSpecifyRecord]![txtName] Is Null
(no line break) but I cannot figure out how to do that
with Between...And. I will never need to specify that
[txtEndDate] Is Null, since it defaults to the current
date.