There is multiple ways of doing this... you can use the DoCmd.OpenReport
Where statement... you can create a query linked to a table that has criteria
linked to a control on a form. So on the form you would have a date range...
like datestart and dateend.
In the query criteria you would put between Forms!yourform!datestart And
Forms!yourform!dateend
> i am making a report every week from the same database but dont want the data
> i put into a report last week into the report for this week. I there anyway
> i can select the data i want to put in?
We'll call your date field WkDate
Create a query based on the same table as your report uses. In Design View
of the query, in the Criteria row, under your date field type
Between Date() And (Date()-7)
Name your query
QryLastWeeksData
Open your report in Design View
Click on Properties,
On the Data tab, next to Record Source, click the DownArrow and choose
QryLastWeeksData.
This will show the data for the last 7 days
If you want to show data for the current week even if the week hasn't
finished yet, in a new column in your query, in design view, type
WeekSt:
DateValue(Int(NZ([WkDate])))+1-DatePart("w",DateValue(Int(NZ([WkDate]))),2)
This gives you the date of the first Monday of the week in which the date
falls
In the criterial row under this put
DateValue(Int(NZ(Date())))+1-DatePart("w",DateValue(Int(NZ(Date()))),2)
Evi
> i am making a report every week from the same database but dont want the data
> i put into a report last week into the report for this week. I there anyway
> i can select the data i want to put in?