Totals up to a Certain date

  • Thread starter Thread starter JoeCL
  • Start date Start date
J

JoeCL

Hello!

My table has field called [First Date] and [Department]. I
want to produce a report from the first record of the
table to a particular date (parameter) in query. Ex. up to
12/25/03. The report woul be summarized by department up
to the date specified. I can also base my report from a
query. Any help would be greately appreciated. Thanks.
 
JoeCL said:
My table has field called [First Date] and [Department]. I
want to produce a report from the first record of the
table to a particular date (parameter) in query. Ex. up to
12/25/03. The report woul be summarized by department up
to the date specified. I can also base my report from a
query.


Ceate the report so that it works as desired, but without
regard for the date. After you get that working, then
create a form with an unbound text box for the users to
enter the last date you want in the report and a command
button to open the report (wizard will generate the basic
code). Then modify the code behind the button to look like
this:

Dim stDoc As String
Dim stWhere As String

stDoc = "nameofreport"
stWhere = "[First Date] <= " & _
Format(thetextbox. "\#m\/d\/yyyy\#")
DoCmd.OpenReport stDoc, acViewPreview, , stWhere
 
Back
Top