PC Review


Reply
Thread Tools Rate Thread

Date ranges showing on report

 
 
Bill McGill
Guest
Posts: n/a
 
      26th Aug 2003
I am using Access 2002 SP 2

I have a report which draws it's data from a query.
I have a date range prompt within the query:
"Between[Start Date]and[End Date]"

When I run the report I would like to have this date range
appear on the report.

Thank you.
 
Reply With Quote
 
 
 
 
Wayne Morgan
Guest
Posts: n/a
 
      26th Aug 2003
Instead of letting the query prompt you, when you open the report have the report pop-up a
form to ask for those dates. Do this in the Form's Open event, before the record source is
read. Open the form with the acDialog window mode parameter to stop the code from running
until the form is closed or hidden. There would be 2 text boxes on the form (one for each
date), a label explaining what you want, and Ok and Cancel buttons. When you click Ok, you
will verify that correct data has been entered into the text boxes then hide the form
(Me.Visible = False). If Cancel is clicked, close the form. Have the next line of code in
the Open event check to see if the form is open (hidden is still open). If it isn't, then
you know that the user chose Cancel and you can Cancel the Open Event of the report as
well. If it is, then just let the report continue to open.

In the query, your Between statement will now refer to the 2 textboxes on the form for the
parameter.

Between Forms!frmMyPopup!txtStartDate And Forms!frmMyPopup!txtEndDate

Access will probably put brackets around the components above when you exit the box in the
query design grid.

Between [Forms]![frmMyPopup]!.....

When you exit the report, close the form.

--
Wayne Morgan
Microsoft Access MVP


"Bill McGill" <(E-Mail Removed)> wrote in message
news:0bf101c36bbd$e0074670$(E-Mail Removed)...
> I am using Access 2002 SP 2
>
> I have a report which draws it's data from a query.
> I have a date range prompt within the query:
> "Between[Start Date]and[End Date]"
>
> When I run the report I would like to have this date range
> appear on the report.
>
> Thank you.



 
Reply With Quote
 
Wayne Morgan
Guest
Posts: n/a
 
      26th Aug 2003
PS. I forgot to mention this part. In the report, you can also get the values of the
textboxes on the form by referring to them the same way you do in the query. For example
you could have a textbox with a Control Source similar to this:

="Dates reported: " & Forms!frmMyPopup!txtStartDate & " to " & Forms!frmMyPopup!txtEndDate

--
Wayne Morgan
Microsoft Access MVP


"Bill McGill" <(E-Mail Removed)> wrote in message
news:0bf101c36bbd$e0074670$(E-Mail Removed)...
> I am using Access 2002 SP 2
>
> I have a report which draws it's data from a query.
> I have a date range prompt within the query:
> "Between[Start Date]and[End Date]"
>
> When I run the report I would like to have this date range
> appear on the report.
>
> Thank you.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Showing Date Ranges For Each Day In Outlook 2003 Lance Hebert Microsoft Outlook Discussion 1 23rd Jan 2009 03:30 PM
Report Date Ranges =?Utf-8?B?Sm9lSg==?= Microsoft Access Reports 7 15th Mar 2007 12:56 PM
Putting in the Date ranges on a report =?Utf-8?B?UmhldHRfWQ==?= Microsoft Access Reports 3 13th Oct 2005 05:22 PM
Report on nonconsistent date ranges =?Utf-8?B?R3JlZ1NEVw==?= Microsoft Access Reports 0 27th Jan 2004 10:36 PM
Report on nonconsistent date ranges =?Utf-8?B?R3JlZ1NEVw==?= Microsoft Access Queries 1 27th Jan 2004 09:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:26 PM.