RE: Passing Qry as part of Rpt DoCmd.OpenReport
- From: JeffP-> <JeffP@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 4 Feb 2008 11:44:00 -0800
On my snippyness, you mis-interpeted my notification, it was meant to advise
you nothing more.
Where: I havent included the keyword "where" in my DoCmd.Open report, should
I?
Perhaps I'm missing something, my understanding was that a filter is applied
after the data is returned and that the "where" clause was part of the
initial dataset creatation?
"Klatuu" wrote:
The argument you are using in the OpenReport method is the Filter argument..
You are, by your description, trying to filter the output of the report.
Maybe that is where I derived the word.
Sorry you did not understand the post. Maybe you need more explanation.
If you create a string that is a Where Clause without the word Where, you
use it in the Where argument of the OpenReport method. By definition, the
Where Clause Filters records (there is that word again).
If you need further explanation, please post back.
BTW, I don't mind you rating as unhelpful, but I do take exception to your
attitude. This site is not manned by paid Microsoft employees. We are all
volunteers. Most of us are Access developers working either on our own or
for a company doing Access development work. So, If you don't get the answer
you want, post back with a question for clarification. Being snippy to other
posters won't get you many answers for very long.
I suggest you visit this site:
http://www.mvps.org/access/netiquette.htm
--
Dave Hargis, Microsoft Access MVP
"JeffP->" wrote:
I'm not sure where you derived the word "filter" from? I've marked your reply
"No" unhelpful, if you'd like me to correct it consider the following,
perhaps I am wrong.
Note that in my DoCmd there are two commas after view type, the first closes
viewtype and the second the empty filter value followed by the where clause.
DoCmd.OpenReport sReportName, acViewPreview, , sQry
And yes my data query is plain vanillia with no where clause only a single
join to get the year from the year/invoice order range table, and again my
year query works fine and if I paste in the value from sQry into my data
query add the keyword where it runs perfect returning my known data.
TIA
JeffP...
"Klatuu" wrote:
May I offer a better solution. Make your query for the record source of
your report plain vanilla with no filtering other than what would be needed
to include all records for the report. Then, rather than using the Filter
argument of the OpenReport, use the Where argument of the OpenReport. It is
like putting a Where clause in your query. Using the Where argument makes it
a lot more flexible.
--
Dave Hargis, Microsoft Access MVP
"JeffP->" wrote:
If the selected manufacturer = "_All" first value in list, then my query
sQry = "Year = " & ddlYear.Value
else: sQry = "Year = & ddlYear.Value & " and manufacturer = " & ddlManu.Value
... also tried: "...=" & "'" & ddlManu.Value & "'"
DoCmd.OpenReport sReportName, acViewPreview, , sQry
Checking the value of sQry shows "Year = 2007 and manufactuer = 'TRMCO'" But
I still get the same data set as "Year = 2007" When I query by pasting the
same where clase into my data query I get only TRMCO w/in 2007.
Any help or insight ?
- Follow-Ups:
- RE: Passing Qry as part of Rpt DoCmd.OpenReport
- From: Duane Hookom
- RE: Passing Qry as part of Rpt DoCmd.OpenReport
- From: Klatuu
- RE: Passing Qry as part of Rpt DoCmd.OpenReport
- References:
- RE: Passing Qry as part of Rpt DoCmd.OpenReport
- From: JeffP->
- RE: Passing Qry as part of Rpt DoCmd.OpenReport
- From: Klatuu
- RE: Passing Qry as part of Rpt DoCmd.OpenReport
- Prev by Date: Dlookup Help
- Next by Date: RE: Passing Qry as part of Rpt DoCmd.OpenReport
- Previous by thread: RE: Passing Qry as part of Rpt DoCmd.OpenReport
- Next by thread: RE: Passing Qry as part of Rpt DoCmd.OpenReport
- Index(es):
Relevant Pages
|
|