dynamic reporting

S

san.r82

hii,
for example i have a report (in microsoft access) which displays the
sales of a small-scale industry from jan10th -06 to dec16 -06 and i
want the user to reuse the same report for displaying the sales from/to
particular date like may06 to aug06, coz if the user wants to take a
printout of the report and if he doesnt want all the sales from jan to
dec ,he should be able to select the data that is needed. is there
anybody who can help with this problem.
 
J

Jeff Boyce

Create a form with two textboxes, to hold StartDate and EndDate.

Create a query that returns the data you want in your report, and includes
the sales/date info.

In the Criteria "cell" under the date field in the query, refer to the
form's controls, something like:
Between #Forms!YourForm!StartDate# And #Forms!YourForm!EndDate#

In design view of your report, point to the query you built above.

Put a command button on the form that opens the report.

NOTE: this approach only works if the form is open and there are values in
the Start/End fields.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
G

GP

Jeff -- Your response below was helpful, but i'm having difficulties getting
this to work. I've re-created the scenario you layed out, but when I enter
in my Criteria is always displays the error: "The Expression you've entered
has an invalid date value" What do you suppose i'm doing wrong? I have the
form open and date values entered. I just can't get the criteria to work in
my query. Any help would be appreciated!
 
J

Jeff Boyce

An error message like that makes me wonder if the field you are comparing to
is actually an Access date/time data type field.

You might also need to add the references to the form as parameters (with
correct data types) in the query design view, using Query | Parameters from
the menu.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top