By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,635 Members | 917 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,635 IT Pros & Developers. It's quick & easy.

Problems with Report Where Condition

P: n/a
I am trying to implement the code to "Print only the Current Record in a
report as posted by Dav Ashish. But I am having a problem. I get a
parameter Entry box asking me to enter the OrderID, then the report print
all the records.

What am I doing wrong?

My Code:

Dim stDocName As String
stDocName = "PackListRep"
Dim strWhere As String
strWhere = "[OrderID]=" & Me!OrderId
DoCmd.OpenReport stDocName, , , strWhere

I have a control named OrderID on the form and am running the report
PackListRep. I'm using Access 2002 on XPProfessional.
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Tony Jenkins" <to**********@bellsouth.net> wrote in message
news:za*******************@bignews4.bellsouth.net. ..
I am trying to implement the code to "Print only the Current Record in a
report as posted by Dav Ashish. But I am having a problem. I get a
parameter Entry box asking me to enter the OrderID, then the report print
all the records.

What am I doing wrong?

My Code:

Dim stDocName As String
stDocName = "PackListRep"
Dim strWhere As String
strWhere = "[OrderID]=" & Me!OrderId
DoCmd.OpenReport stDocName, , , strWhere

I have a control named OrderID on the form and am running the report
PackListRep. I'm using Access 2002 on XPProfessional.


But does the Report include a field named [OrderID]? The parameter popup
is indicating it does not.

Your syntax is essentially saying..."Open the PackingListRep report and
only show records where the OrderID field (in the report) = the OrderID
value currently on your form". Obviously, that only makes sense if the
report actually has a field named "OrderID".
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


Nov 12 '05 #2

P: n/a
The form does have a field called OrderID.

"Rick Brandt" <ri*********@hotmail.com> wrote in message news:<bn*************@ID-98015.news.uni-berlin.de>...
"Tony Jenkins" <to**********@bellsouth.net> wrote in message
news:za*******************@bignews4.bellsouth.net. ..
I am trying to implement the code to "Print only the Current Record in a
report as posted by Dav Ashish. But I am having a problem. I get a
parameter Entry box asking me to enter the OrderID, then the report print
all the records.

What am I doing wrong?

My Code:

Dim stDocName As String
stDocName = "PackListRep"
Dim strWhere As String
strWhere = "[OrderID]=" & Me!OrderId
DoCmd.OpenReport stDocName, , , strWhere

I have a control named OrderID on the form and am running the report
PackListRep. I'm using Access 2002 on XPProfessional.


But does the Report include a field named [OrderID]? The parameter popup
is indicating it does not.

Your syntax is essentially saying..."Open the PackingListRep report and
only show records where the OrderID field (in the report) = the OrderID
value currently on your form". Obviously, that only makes sense if the
report actually has a field named "OrderID".

Nov 12 '05 #3

P: n/a
"Tony" <to**********@bellsouth.net> wrote in message
news:3b**************************@posting.google.c om...
The form does have a field called OrderID.


I was not talking about the form. Your expression requires that the REPORT
have a field named OrderID.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.