Re: Report Date Range or all dates
From: fredg (fgutkind_at_example.invalid)
Date: 12/29/04
- Next message: Ken Snell [MVP]: "Re: Variable Losing Value"
- Previous message: PC Data***: "Re: How to arrange values in combo box"
- In reply to: James: "Report Date Range or all dates"
- Next in thread: James: "Re: Report Date Range or all dates"
- Reply: James: "Re: Report Date Range or all dates"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 29 Dec 2004 00:30:04 GMT
On Tue, 28 Dec 2004 13:11:03 -0800, James wrote:
> I have reports that only display between the dates on the "Reports Date
> Range" form. How do I have a button for "Month to date" and one for "All
> Records"?
One button is all you really need.
Code the Button's Click event:
If IsNull([StartDate]) and IsNull([EndDate]) then
DoCmd.OpenReport "ReportName",acViewPreview
Else
DoCmd.OpenReport "ReportName",acViewPreview, , "[DateField] Between
#" & Me![StartDate] & "# and #" & Me![EndDate] & "#"
End If
Enter no date at all to get all the records, or both to get the date
range wanted.
You will probably want to also check to see if just one of the dates
has been entered and give the user a chance to rectify it.
-- Fred Please only reply to this newsgroup. I do not reply to personal email.
- Next message: Ken Snell [MVP]: "Re: Variable Losing Value"
- Previous message: PC Data***: "Re: How to arrange values in combo box"
- In reply to: James: "Report Date Range or all dates"
- Next in thread: James: "Re: Report Date Range or all dates"
- Reply: James: "Re: Report Date Range or all dates"
- Messages sorted by: [ date ] [ thread ]