(Msg. 1) Posted: Wed Sep 03, 2008 4:52 pm
Post subject: report & subreport date field Archived from groups: microsoft>public>access>reports (more info?)
Hi there,
I have one main report and one subreport.
In both queries i have in the date column the following criteria:
Between [Type Report Start Date (dd/mm/yyy):] And [Type End Date
(dd/mm/yyy):]
When i view the reports individually i am asked to enter the start and end
dates. But now that i have one as a sub report i have to type in the dates 2
times each. Is there a way to only type this once.
My next problem is that i have a text box on both reports that display the
start and end dates. The control source for these text boxes are:=[Type SMA
Report Start Date (dd/mm/yyy):] and for the end date it is =[Type SMA End
Date (dd/mm/yyy):].
And as you could imagine when i try to view the report i am asked for the
date 8 + times.
(Msg. 2) Posted: Thu Sep 04, 2008 3:00 am
Post subject: Re: report & subreport date field [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
1. Create a form, with 2 unbound text boxes where the user can enter the
dates.
2. Change the queries so they refer to the text boxes, e.g.:
Between [Forms].[Form1].[StartDate] And [Forms].[Form1].[EndDate]
3. Change the reports to they refer to the text boxes too:
=[Forms].[Form1].[StartDate]
4. Open the report from the form.
To ensure this all goes smoothly:
a) Set the Format property of the text boxes to Short Date or similar, so
Access knows they are dates.
b) Declare the parameters in the query. Choose Parameters on Query menu (in
query design), and enter 2 rows in the dialog:
[Forms].[Form1].[StartDate] Date
[Forms].[Form1].[EndDate] Date
c) The command button on the form can check for the dates before it opens
the report. Example event procedure for the button's Click event:
Private Sub cmdPreview_Click()
If IsNull(Me.StartDate) Or IsNull(Me.EndDate) Then
MsgBox "Both dates."
Else
DoCmd.OpenReport "Report1", acViewPreview
End If
End Sub
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"George" <George.TakeThisOut@discussions.microsoft.com> wrote in message
news:EE34C3C2-4B58-46D9-A818-B8543B5B61EF@microsoft.com...
> Hi there,
> I have one main report and one subreport.
>
> In both queries i have in the date column the following criteria:
> Between [Type Report Start Date (dd/mm/yyy):] And [Type End Date
> (dd/mm/yyy):]
>
> When i view the reports individually i am asked to enter the start and end
> dates. But now that i have one as a sub report i have to type in the dates
> 2
> times each. Is there a way to only type this once.
>
> My next problem is that i have a text box on both reports that display the
> start and end dates. The control source for these text boxes are:=[Type
> SMA
> Report Start Date (dd/mm/yyy):] and for the end date it is =[Type SMA End
> Date (dd/mm/yyy):].
>
> And as you could imagine when i try to view the report i am asked for the
> date 8 + times.
(Msg. 3) Posted: Thu Sep 04, 2008 3:00 am
Post subject: Re: report & subreport date field [Login to view extended thread Info.] Archived from groups: per prev. post (more info?)
Thanks Allen,
that worked a treat. the only way to open is through the use of the form as
if i try to open the report from the reports section of access i get prompted
to enter the date 10 times again.
Cheers
George
"Allen Browne" wrote:
> 1. Create a form, with 2 unbound text boxes where the user can enter the
> dates.
>
> 2. Change the queries so they refer to the text boxes, e.g.:
> Between [Forms].[Form1].[StartDate] And [Forms].[Form1].[EndDate]
>
> 3. Change the reports to they refer to the text boxes too:
> =[Forms].[Form1].[StartDate]
>
> 4. Open the report from the form.
>
> To ensure this all goes smoothly:
> a) Set the Format property of the text boxes to Short Date or similar, so
> Access knows they are dates.
>
> b) Declare the parameters in the query. Choose Parameters on Query menu (in
> query design), and enter 2 rows in the dialog:
> [Forms].[Form1].[StartDate] Date
> [Forms].[Form1].[EndDate] Date
>
> c) The command button on the form can check for the dates before it opens
> the report. Example event procedure for the button's Click event:
>
> Private Sub cmdPreview_Click()
> If IsNull(Me.StartDate) Or IsNull(Me.EndDate) Then
> MsgBox "Both dates."
> Else
> DoCmd.OpenReport "Report1", acViewPreview
> End If
> End Sub
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html > Reply to group, rather than allenbrowne at mvps dot org.
>
> "George" <George.DeleteThis@discussions.microsoft.com> wrote in message
> news:EE34C3C2-4B58-46D9-A818-B8543B5B61EF@microsoft.com...
> > Hi there,
> > I have one main report and one subreport.
> >
> > In both queries i have in the date column the following criteria:
> > Between [Type Report Start Date (dd/mm/yyy):] And [Type End Date
> > (dd/mm/yyy):]
> >
> > When i view the reports individually i am asked to enter the start and end
> > dates. But now that i have one as a sub report i have to type in the dates
> > 2
> > times each. Is there a way to only type this once.
> >
> > My next problem is that i have a text box on both reports that display the
> > start and end dates. The control source for these text boxes are:=[Type
> > SMA
> > Report Start Date (dd/mm/yyy):] and for the end date it is =[Type SMA End
> > Date (dd/mm/yyy):].
> >
> > And as you could imagine when i try to view the report i am asked for the
> > date 8 + times.
>
>
All times are: Eastern Time (US & Canada) (change)
Page 1 of 1
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum