473,324 Members | 2,268 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Problems with Report Where Condition

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
3 4777
"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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Blah | last post by:
Hello, I'm trying to use the where clause in OpenReport to limit the data return on the subreport. Is there a way to do it using that method or OpenReport only work with the report you're...
1
by: Chasing Gates | last post by:
I have created a database that brings in a new table weekly. I then made a separate query for each sales rep and a separate report for each rep. (The reports are all identical but call different...
15
by: Richard Hollenbeck | last post by:
I tried to ask this question before on the 14th of January but I never got a reply. I'm still struggling with the problem. I'll try to rephrase the question: I have a crosstab query with rows...
7
by: Mark | last post by:
Hi All, I have a report which is based on a query which is used to produce QC check sheets. I have quite a few text boxes which are used to display questions depending on the value of one...
8
by: John Welch | last post by:
I have a command button with the following code: DoCmd.OpenForm "frmSearchAssignments", , , "SearchAssignmentID = 1" (SearchAssignmentID is the PK, auto number) When it runs, the form opens but...
2
by: Joel D. Kraft | last post by:
I've been very happy with the performance and new features of my site since we converted to ASP.NET 2.0 beta 2. I have noticed a couple of interesting problems, though, which I am trying to...
5
by: jimc52 | last post by:
Hello Everyone: I am hoping one of the gurus here will give me some help. I have designed a form with some check boxes. I put the checkboxes there on the form so later I could use them as flags on...
1
by: Intrepid_Yellow | last post by:
Hi, I have the following code that runs my report generator. The user selects a table from a combo box, then whatever fields they want from a list box. (This part all works and the report runs...
1
by: sonicfun2006 | last post by:
I have SQL Server Database and MS Access 2003 is connected with ODBC. I have very large amount of records in various tables. The database is very dynamic as it changes every minute. I’m trying to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.