Need to generate a report for records with certain dates

  • Thread starter Thread starter James
  • Start date Start date
J

James

I have a database with about 25 fields in my table. I
have created a report that pulls information from this
table. The person using this report function needs to be
able to print the records that only occur during certain
date ranges (i.e quarterly). I have a field in the table
for "Application Date". What I would like, is for the
report to ask me what date ranges I would like before it
generates the results that we need to print. I'm a
newbie to Access, so I don't have a lot of database
skills.

Thanks
James
 
James,

I would recommend making a form which will be open at the time the
report is printed, with two unbound textboxes for the entry of the
date criteria, let's say you name them StartDate and EndDate. Then,
in the criteria of the Application Date field in the query that the
report is based on, put...
Between [Forms]![MyForm]![StartDate] And [Forms]![MyForm]![EndDate]
(replace MyForm with the actual name of your form.)

- Steve Schapel, Microsoft Access MVP
 
I just tried that and but could not get it to open the form. It comes up
with: Enter Parameter Value
forms![MyForm]![StartDate]
It does not open the form. What is wrong?
Annelie

Steve Schapel said:
James,

I would recommend making a form which will be open at the time the
report is printed, with two unbound textboxes for the entry of the
date criteria, let's say you name them StartDate and EndDate. Then,
in the criteria of the Application Date field in the query that the
report is based on, put...
Between [Forms]![MyForm]![StartDate] And [Forms]![MyForm]![EndDate]
(replace MyForm with the actual name of your form.)

- Steve Schapel, Microsoft Access MVP


I have a database with about 25 fields in my table. I
have created a report that pulls information from this
table. The person using this report function needs to be
able to print the records that only occur during certain
date ranges (i.e quarterly). I have a field in the table
for "Application Date". What I would like, is for the
report to ask me what date ranges I would like before it
generates the results that we need to print. I'm a
newbie to Access, so I don't have a lot of database
skills.

Thanks
James
 
Annelie,

No, it is not designed to open the form. The form should already be
open, and the criteria entered in the boxes, before you try to print
the report. The typical way of doing this is to print the report by
clicking a button on the same form that the criteria is entered on.

- Steve Schapel, Microsoft Access MVP
 
Steve, What I have is a table with entries for a low
income program for electric bill assistance. We enter
data on a form that populates our table. After we fill
out each form we print it individually and have the
client sign it. We created a report that will print out
all of the pertinent information about each client so we
may give this report to our local utility company. They
are telling me that this report needs to be able to print
out only the clients that apply during certain time
frames (i.e. quarterly), so I need to be able to somehow
select only the clients during a particular 3 month
period for this report.
-----Original Message-----
Annelie,

No, it is not designed to open the form. The form should already be
open, and the criteria entered in the boxes, before you try to print
the report. The typical way of doing this is to print the report by
clicking a button on the same form that the criteria is entered on.

- Steve Schapel, Microsoft Access MVP


I just tried that and but could not get it to open the form. It comes up
with: Enter Parameter Value
forms![MyForm]![StartDate]
It does not open the form. What is wrong?
Annelie

.
 
Your setup is fine. What you need to do is design a form as Steve suggested.

The way you use it is to open the form, enter the info into the textboxes,
click the command button, and let the command button open the report. The
report needs to use as its recordsource a query that reads the paramters
from the form that you used.

If you want to limit the choice of dates to specific, preset date windows,
you could use a combo box that lists the choices and then use the combo
boxes instead of the textboxes as the source of the parameters in the query.

--
Ken Snell
<MS ACCESS MVP>

James said:
Steve, What I have is a table with entries for a low
income program for electric bill assistance. We enter
data on a form that populates our table. After we fill
out each form we print it individually and have the
client sign it. We created a report that will print out
all of the pertinent information about each client so we
may give this report to our local utility company. They
are telling me that this report needs to be able to print
out only the clients that apply during certain time
frames (i.e. quarterly), so I need to be able to somehow
select only the clients during a particular 3 month
period for this report.
-----Original Message-----
Annelie,

No, it is not designed to open the form. The form should already be
open, and the criteria entered in the boxes, before you try to print
the report. The typical way of doing this is to print the report by
clicking a button on the same form that the criteria is entered on.

- Steve Schapel, Microsoft Access MVP


I just tried that and but could not get it to open the form. It comes up
with: Enter Parameter Value
forms![MyForm]![StartDate]
It does not open the form. What is wrong?
Annelie

.
 
Two questions: First, my current report is based on
fields from a table, not a query, so do I need to
recreate this report? I hope not because it took a long
time to get the layout correct. If I must change it to
be fed by a query, is there a way to change my current
report to get info from the a new query instead of the
table? Also, in your instructions, you mentioned having
a command button to open up the report. How do I do that?

Thanks
James
-----Original Message-----
Your setup is fine. What you need to do is design a form as Steve suggested.

The way you use it is to open the form, enter the info into the textboxes,
click the command button, and let the command button open the report. The
report needs to use as its recordsource a query that reads the paramters
from the form that you used.

If you want to limit the choice of dates to specific, preset date windows,
you could use a combo box that lists the choices and then use the combo
boxes instead of the textboxes as the source of the parameters in the query.

--
Ken Snell
<MS ACCESS MVP>

James said:
Steve, What I have is a table with entries for a low
income program for electric bill assistance. We enter
data on a form that populates our table. After we fill
out each form we print it individually and have the
client sign it. We created a report that will print out
all of the pertinent information about each client so we
may give this report to our local utility company. They
are telling me that this report needs to be able to print
out only the clients that apply during certain time
frames (i.e. quarterly), so I need to be able to somehow
select only the clients during a particular 3 month
period for this report.
-----Original Message-----
Annelie,

No, it is not designed to open the form. The form should already be
open, and the criteria entered in the boxes, before
you
try to print
the report. The typical way of doing this is to print the report by
clicking a button on the same form that the criteria
is
entered on.
- Steve Schapel, Microsoft Access MVP
wrote:

I just tried that and but could not get it to open
the
form. It comes up
with: Enter Parameter Value
forms![MyForm]![StartDate]
It does not open the form. What is wrong?
Annelie

.


.
 
Creating a query to use as the recordsource is very easy. Create a new query
in design view, add the table to the query window, and double-click the *
fielda at the top of the table to put all fields on the grid. Then pull onto
the grid the actual fields that you want to use as the filtering fields.
Under those fields, use the criterion expressions based on reading the
form's controls. Deselect the "Show" checkbox for these fields with the
criterion expressions under them. Save the query; name it qryReportQuery (or
whatever you want).

Open the report in design view, click on Properties icon on toolbar, select
Data tab, and click in box next to Record Source. Use the combo box to
select the query that you just created. Save the report.

To make this work, put a command button on the form that has the controls
that will contain the values needed by the report's query. On the OnClick
event of this command button, put this generic code (change the name of the
report and the button to the actual name):

Private Sub cmdButtonName_Click()
DoCmd.OpenReport "ReportName"
End Sub


--
Ken Snell
<MS ACCESS MVP>

James said:
Two questions: First, my current report is based on
fields from a table, not a query, so do I need to
recreate this report? I hope not because it took a long
time to get the layout correct. If I must change it to
be fed by a query, is there a way to change my current
report to get info from the a new query instead of the
table? Also, in your instructions, you mentioned having
a command button to open up the report. How do I do that?

Thanks
James
-----Original Message-----
Your setup is fine. What you need to do is design a form as Steve suggested.

The way you use it is to open the form, enter the info into the textboxes,
click the command button, and let the command button open the report. The
report needs to use as its recordsource a query that reads the paramters
from the form that you used.

If you want to limit the choice of dates to specific, preset date windows,
you could use a combo box that lists the choices and then use the combo
boxes instead of the textboxes as the source of the parameters in the query.

--
Ken Snell
<MS ACCESS MVP>

James said:
Steve, What I have is a table with entries for a low
income program for electric bill assistance. We enter
data on a form that populates our table. After we fill
out each form we print it individually and have the
client sign it. We created a report that will print out
all of the pertinent information about each client so we
may give this report to our local utility company. They
are telling me that this report needs to be able to print
out only the clients that apply during certain time
frames (i.e. quarterly), so I need to be able to somehow
select only the clients during a particular 3 month
period for this report.

-----Original Message-----
Annelie,

No, it is not designed to open the form. The form
should already be
open, and the criteria entered in the boxes, before you
try to print
the report. The typical way of doing this is to print
the report by
clicking a button on the same form that the criteria is
entered on.

- Steve Schapel, Microsoft Access MVP


On Thu, 30 Oct 2003 09:19:40 -0500, "Annelie"
<[email protected]>
wrote:

I just tried that and but could not get it to open the
form. It comes up
with: Enter Parameter Value
forms![MyForm]![StartDate]
It does not open the form. What is wrong?
Annelie

.


.
 
Back
Top