I've created a report. I would like for user to decide what dates they want
to see on report. (I think I need a parameter???? query)?
What type of query do I create where user is prompted to enter a 'Begin
Date' and and 'End Date'.. and have that data appear on report.
What are the steps to do this?????
Note: My date is in short date format
|
|
0
|
|
|
|
Reply
|
Utf
|
3/25/2010 8:00:01 PM |
|
On Mar 25, 4:00=A0pm, Summing multiple fields on a form
<Summingmultiplefieldsonaf...@discussions.microsoft.com> wrote:
> I've created a report. I would like for user to decide what dates they wa=
nt
> to see on report. (I think I need a parameter???? query)?
>
> What type of query do I create where user is prompted to enter a 'Begin
> Date' and and 'End Date'.. and have that data appear on report.
>
> What are the steps to do this?????
>
> Note: My date is in short date format
Create a select query on citiria between fromdate to enddate
Then create the report using this query.
Hopes it help....
|
|
0
|
|
|
|
Reply
|
HC
|
3/25/2010 8:05:40 PM
|
|
Thx Hc...but how do I make the query as part of the report???
"HC" wrote:
> On Mar 25, 4:00 pm, Summing multiple fields on a form
> <Summingmultiplefieldsonaf...@discussions.microsoft.com> wrote:
> > I've created a report. I would like for user to decide what dates they want
> > to see on report. (I think I need a parameter???? query)?
> >
> > What type of query do I create where user is prompted to enter a 'Begin
> > Date' and and 'End Date'.. and have that data appear on report.
> >
> > What are the steps to do this?????
> >
> > Note: My date is in short date format
>
> Create a select query on citiria between fromdate to enddate
>
> Then create the report using this query.
>
>
> Hopes it help....
>
>
>
> .
>
|
|
0
|
|
|
|
Reply
|
Utf
|
3/26/2010 1:21:01 AM
|
|
Do yourself a favor and create a form with a couple text boxes [txtStartDate]
and [txtEndDate] for the user to enter the dates. Then use the command button
wizard to create a button to open your report.
This should create code like:
Private Sub cmdOpenReport_Click()
On Error GoTo Err_cmdOpenReport_Click
Dim stDocName As String
'== add these lines to match your field and control names ==
Dim strWhere As String
If Not IsNull(Me.txtStartDate) Then
strWhere = strWhere & " AND [YourDateField] >= #" & _
Me.txtStartDate & "# "
End If
If Not IsNull(Me.txtEndDate) Then
strWhere = strWhere & " AND [YourDateField] <= #" & _
Me.txtEndDate & "# "
End If
'===========================================
stDocName = "Order Details"
'add two commas and strWhere to the next line
DoCmd.OpenReport stDocName, acPreview, , strWhere
Exit_cmdOpenReport_Click:
Exit Sub
Err_cmdOpenReport_Click:
MsgBox Err.Description
Resume Exit_cmdOpenReport_Click
End Sub
--
Duane Hookom
Microsoft Access MVP
"Summing multiple fields on a form" wrote:
> I've created a report. I would like for user to decide what dates they want
> to see on report. (I think I need a parameter???? query)?
>
> What type of query do I create where user is prompted to enter a 'Begin
> Date' and and 'End Date'.. and have that data appear on report.
>
> What are the steps to do this?????
>
> Note: My date is in short date format
|
|
0
|
|
|
|
Reply
|
Utf
|
3/26/2010 2:18:01 PM
|
|