From: Summing multiple fields on a form on
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
From: HC on
On Mar 25, 4:00 pm, Summing multiple fields on a form
<Summingmultiplefieldsonaf...(a)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....



From: Summing multiple fields on a form on
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...(a)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....
>
>
>
> .
>
From: Duane Hookom on
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