Report from specific colums

G

Guest

Hi,
Hope I can get some help because I'm really stuck with this one.
I created a form from Table1 that aks for Beginning Date / Ending Date /
Vendor.
I created a query from same Table1 with the following arguments.
Under Date: Between [Forms]![Name of Form]![Beginning Date] And
[Forms]![Name of Form]![Ending Date]
Under Vendor: [Forms]![Name of Form]![Vendor]

When I run the query it brings up a prompt asking me for Beginning Date /
Ending Date / Vendor and the result is exactly what I need.

The form seems to be OK as well, all selections are unbound. I'm also
running a Macro that defines Open/Close/Cancel and it too seems to be working
OK.

When I select the report it takes me to the correct form and it asks for the
fields that I need. This is where I'm encountering the problem.
1. The cancel button does not cancel but moves me into the report.
2. (The big problem) The report I get includes every single entry,
regardless of what I specified in the Form fields.

I know that it is probably a simple step that I'm missing but I've been
looking at this for so long that I no longer know what's right or wrong.
 
A

Allen Browne

You may find it easier and more flexible to remove the criteria from the
query. Instead use the WhereCondition of OpenReport to limit the report.

There's an example in this article:
Limiting a Report to a Date Range
at:
http://allenbrowne.com/casu-08.html

The first approach explained in the article is what you are currently doing.
The second one is the alternative.

If you want to stay with your current approach, step 3 (delcaring the
parameters) might help.
 
G

Guest

Allen,
Thanks so much for your reply. What was bothering the most was that the
Form was OK, the Macro was OK and the Report seemed OK but the response to
the dates I was entering was wrong.
For some weird reason I made a mistake on the entry and I typed the wrong
date and all of a sudden, "it worked." Turns out that the Macro argument
needed to have the end date first and the beginning date next. Once I
changed it accordingly everything just felt into place.
Again, thanks for your help.


Allen Browne said:
You may find it easier and more flexible to remove the criteria from the
query. Instead use the WhereCondition of OpenReport to limit the report.

There's an example in this article:
Limiting a Report to a Date Range
at:
http://allenbrowne.com/casu-08.html

The first approach explained in the article is what you are currently doing.
The second one is the alternative.

If you want to stay with your current approach, step 3 (delcaring the
parameters) might help.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

JL said:
Hi,
Hope I can get some help because I'm really stuck with this one.
I created a form from Table1 that aks for Beginning Date / Ending Date /
Vendor.
I created a query from same Table1 with the following arguments.
Under Date: Between [Forms]![Name of Form]![Beginning Date] And
[Forms]![Name of Form]![Ending Date]
Under Vendor: [Forms]![Name of Form]![Vendor]

When I run the query it brings up a prompt asking me for Beginning Date /
Ending Date / Vendor and the result is exactly what I need.

The form seems to be OK as well, all selections are unbound. I'm also
running a Macro that defines Open/Close/Cancel and it too seems to be
working
OK.

When I select the report it takes me to the correct form and it asks for
the
fields that I need. This is where I'm encountering the problem.
1. The cancel button does not cancel but moves me into the report.
2. (The big problem) The report I get includes every single entry,
regardless of what I specified in the Form fields.

I know that it is probably a simple step that I'm missing but I've been
looking at this for so long that I no longer know what's right or wrong.
 

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