For something like that I usually use a "Launcher" form (I think I made that
up). I use them for gathering some pretty complex parameters for reports
before actually firing them off. Your case sounds pretty simple. Let the
command button that now opens the form for printing open a new launcher form
instead. On your launcher put a couple of textboxes: BeginDate and
EndDate. and a command button that does what your original Print command
button did. On the report, put a textbox and for it's datasource put an
equation that goes something like: =forms!myLuncher!BeginDate " & "through
" & forms!myLauncher!EndDate put square brackets around any term with a
space in it. You can adjust its size and font appropriate to the header
you're designing.
The above leaves the burden of remembering the date format you want on your
users. In that situation, I would actually use some more code and a
calendar form so that doubleclicking in either of the date textboxes would
bring up a calendar that I could scroll to the correct date and then click.
It would return the selected date to the textbox. I would then format the
textboxes to display the date appropriately. That would let the user just
point and click for the date and the rest is all automatic. The only errors
left would be scrolling errors in picking a date: wrong month, wrong year,
etc. Most people would never make a scrolling error.
HTH
--
-Larry-
--
TinleyParkILGal said:
Larry, thank you...I did refer to help but my situation was a little unique
and I couldn't quite figure out the syntax.
The next thing I need to accomplish is to use a header that will spell out
the full dates for each month: example: March 1 through March 31, 2005 (even
though the report may not contain records for each and every date in March).
Larry Daugherty said:
Hi,
Be careful not to use reserved words for field names or control names.
In your query, create two new fields as follows:
MyMonth: format([MyDate], "mmmm")
MyYear: format([MyDate'],"YYYY")
For more info on Date and Time formats, look them up in Access's Help.
HTH
--
-Larry-
--
TinleyParkILGal said:
Professionals:
I have a short date field in a table (example: 2/23/05).
I want to design a query that will use this date but that will separate it
and put the month in one field as February and then 2005 in a second
field
as
the year.
Example:
Date Field Will Reflect: 2/23/05
Month Field Will Reflect: February
Year Field Will Reflect: 2005
Thanks in advance.