473,396 Members | 1,886 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,396 software developers and data experts.

Print report by filter

N J
Hi,

I am trying to get a report to print based on what ID number I type into a
text box, but it just prints all records in the table :(

Dim stDocName As String
Dim strWhere As String

strWhere = "[ID] = " & Me.[txtOrderID]

stDocName = "rptLabelsWDM_single"
DoCmd.OpenReport stDocName, acNormal

txtOrderID.SetFocus

Thank You,

--

Kind Regards,
Customer Services
P.S. For us to answer your emails efficiently, please always include the
original message. Thank you.
Nov 13 '05 #1
10 5034
you are building your filter but never applying it in the Open event of
your report

DoCmd.OpenReport stDocName, acNormal, strWhere

Nov 13 '05 #2
you are building your filter but never applying it in the Open event of
your report

DoCmd.OpenReport stDocName, acNormal, strWhere

Nov 13 '05 #3
On Wed, 03 Aug 2005 20:45:12 GMT, N J wrote:
Hi,

I am trying to get a report to print based on what ID number I type into a
text box, but it just prints all records in the table :(

Dim stDocName As String
Dim strWhere As String

strWhere = "[ID] = " & Me.[txtOrderID]

stDocName = "rptLabelsWDM_single"
DoCmd.OpenReport stDocName, acNormal

txtOrderID.SetFocus

Thank You,


strWhere is the where clause to filter the records, but you never
added it to the where clause argument position.

DoCmd.OpenReport stDocName, acNormal, ,strWhere

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #4
On Wed, 03 Aug 2005 20:45:12 GMT, N J wrote:
Hi,

I am trying to get a report to print based on what ID number I type into a
text box, but it just prints all records in the table :(

Dim stDocName As String
Dim strWhere As String

strWhere = "[ID] = " & Me.[txtOrderID]

stDocName = "rptLabelsWDM_single"
DoCmd.OpenReport stDocName, acNormal

txtOrderID.SetFocus

Thank You,


strWhere is the where clause to filter the records, but you never
added it to the where clause argument position.

DoCmd.OpenReport stDocName, acNormal, ,strWhere

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #5
N J
Hi,

It still does the same problem :s...

Private Sub cmdGetOrderStatus_Click()
Dim stDocName As String
Dim strWhere As String

strWhere = "[ID] = " & Me.[txtOrderID]

stDocName = "rptLabelsWDM_single"
DoCmd.OpenReport stDocName, acNormal, strWhere

txtOrderID.SetFocus
End Sub

--

Kind Regards,
Customer Services
P.S. For us to answer your emails efficiently, please always include the
original message. Thank you.
"fredg" <fg******@example.invalid> wrote in message
news:d3*****************************@40tude.net...
On Wed, 03 Aug 2005 20:45:12 GMT, N J wrote:
Hi,

I am trying to get a report to print based on what ID number I type into
a
text box, but it just prints all records in the table :(

Dim stDocName As String
Dim strWhere As String

strWhere = "[ID] = " & Me.[txtOrderID]

stDocName = "rptLabelsWDM_single"
DoCmd.OpenReport stDocName, acNormal

txtOrderID.SetFocus

Thank You,


strWhere is the where clause to filter the records, but you never
added it to the where clause argument position.

DoCmd.OpenReport stDocName, acNormal, ,strWhere

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.

Nov 13 '05 #6
N J
Hi,

It still does the same problem :s...

Private Sub cmdGetOrderStatus_Click()
Dim stDocName As String
Dim strWhere As String

strWhere = "[ID] = " & Me.[txtOrderID]

stDocName = "rptLabelsWDM_single"
DoCmd.OpenReport stDocName, acNormal, strWhere

txtOrderID.SetFocus
End Sub

--

Kind Regards,
Customer Services
P.S. For us to answer your emails efficiently, please always include the
original message. Thank you.
"fredg" <fg******@example.invalid> wrote in message
news:d3*****************************@40tude.net...
On Wed, 03 Aug 2005 20:45:12 GMT, N J wrote:
Hi,

I am trying to get a report to print based on what ID number I type into
a
text box, but it just prints all records in the table :(

Dim stDocName As String
Dim strWhere As String

strWhere = "[ID] = " & Me.[txtOrderID]

stDocName = "rptLabelsWDM_single"
DoCmd.OpenReport stDocName, acNormal

txtOrderID.SetFocus

Thank You,


strWhere is the where clause to filter the records, but you never
added it to the where clause argument position.

DoCmd.OpenReport stDocName, acNormal, ,strWhere

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.

Nov 13 '05 #7
On Wed, 03 Aug 2005 22:30:25 GMT, N J wrote:
Hi,

It still does the same problem :s...

Private Sub cmdGetOrderStatus_Click()
Dim stDocName As String
Dim strWhere As String

strWhere = "[ID] = " & Me.[txtOrderID]

stDocName = "rptLabelsWDM_single"
DoCmd.OpenReport stDocName, acNormal, strWhere

txtOrderID.SetFocus
End Sub


Look at my reply again.
You didn't place the strWhere in the correct position.
It goes in the Where clause argument position.
You placed it in the Filter position.
That's what those 3 commas are for.
If you leave one out it won't work.
Docmd.OpenReport "TheReportName", View, Filter, Where

DoCmd.OpenReport stDocName, acNormal, ,strWhere

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #8
On Wed, 03 Aug 2005 22:30:25 GMT, N J wrote:
Hi,

It still does the same problem :s...

Private Sub cmdGetOrderStatus_Click()
Dim stDocName As String
Dim strWhere As String

strWhere = "[ID] = " & Me.[txtOrderID]

stDocName = "rptLabelsWDM_single"
DoCmd.OpenReport stDocName, acNormal, strWhere

txtOrderID.SetFocus
End Sub


Look at my reply again.
You didn't place the strWhere in the correct position.
It goes in the Where clause argument position.
You placed it in the Filter position.
That's what those 3 commas are for.
If you leave one out it won't work.
Docmd.OpenReport "TheReportName", View, Filter, Where

DoCmd.OpenReport stDocName, acNormal, ,strWhere

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #9
N J
Hi,

Sorry, I misread your message, it seems fine now.

--

Kind Regards,
Customer Services
P.S. For us to answer your emails efficiently, please always include the
original message. Thank you.
"fredg" <fg******@example.invalid> wrote in message
news:6w*****************************@40tude.net...
On Wed, 03 Aug 2005 22:30:25 GMT, N J wrote:
Hi,

It still does the same problem :s...

Private Sub cmdGetOrderStatus_Click()
Dim stDocName As String
Dim strWhere As String

strWhere = "[ID] = " & Me.[txtOrderID]

stDocName = "rptLabelsWDM_single"
DoCmd.OpenReport stDocName, acNormal, strWhere

txtOrderID.SetFocus
End Sub


Look at my reply again.
You didn't place the strWhere in the correct position.
It goes in the Where clause argument position.
You placed it in the Filter position.
That's what those 3 commas are for.
If you leave one out it won't work.
Docmd.OpenReport "TheReportName", View, Filter, Where

DoCmd.OpenReport stDocName, acNormal, ,strWhere

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.

Nov 13 '05 #10
N J
Hi,

Sorry, I misread your message, it seems fine now.

--

Kind Regards,
Customer Services
P.S. For us to answer your emails efficiently, please always include the
original message. Thank you.
"fredg" <fg******@example.invalid> wrote in message
news:6w*****************************@40tude.net...
On Wed, 03 Aug 2005 22:30:25 GMT, N J wrote:
Hi,

It still does the same problem :s...

Private Sub cmdGetOrderStatus_Click()
Dim stDocName As String
Dim strWhere As String

strWhere = "[ID] = " & Me.[txtOrderID]

stDocName = "rptLabelsWDM_single"
DoCmd.OpenReport stDocName, acNormal, strWhere

txtOrderID.SetFocus
End Sub


Look at my reply again.
You didn't place the strWhere in the correct position.
It goes in the Where clause argument position.
You placed it in the Filter position.
That's what those 3 commas are for.
If you leave one out it won't work.
Docmd.OpenReport "TheReportName", View, Filter, Where

DoCmd.OpenReport stDocName, acNormal, ,strWhere

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.

Nov 13 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Michael Dekson | last post by:
Access 97. I make a report and I want first to see report and then print report without type CONTROL + P. Can I make some button or can I see print button in toolbar meny. Thanks
2
by: ChadDiesel | last post by:
Hello, I have a form and subform with their tables linked by a field called Load_ID. I have a button on my subform that prints just the items listed on that particular subform (looking at...
5
by: Tony Dong | last post by:
Hi there, I am newer for dot net I want to make a report and then print it, the report may include images and text, how can I do that, any one can give me a suggestion? I know how to...
7
by: fleece | last post by:
I set up a form for searching criteria and pass the searching result to a report. On this report there is an unbound text box (=.Filter) and shows the searching criteria. It works fine when searching...
1
by: thh108688 | last post by:
Hi All, Is anyone know how to do a print report based on my current record. What i would like to get is once i have entered all the value in the form, when i hit the print button, all the value...
2
by: felicia | last post by:
Can anyone help me on How to use Data Report in VB and how to print report? I hope i can generate the Data Report without Data Environment because I am not fammiliar with it. Simple adodb or adodc...
17
imrosie
by: imrosie | last post by:
Hello, I've gone through the tutorials, and searched. Still I can't find a clear solution to my issue. I have a form with a subform that displays a listbox control called 'theOrderID'. I have...
10
by: Snoopy33 | last post by:
I have a DB that I developed on access XP (2002) and deployed over a year ago. No one has had problems printing any of the reports within the DB until we started loading 2007 on new computers. ...
1
by: abil | last post by:
i've already build a program that contain all the price, the change given back to the customer but i dun have no idea which function i should use to do program print report... #include <cstdlib>...
0
by: Marie Gardner | last post by:
Hi, I want to create a form that filters a report that is between a date range, and includes only the data for the item selected in the combo box. For example, I am creating a time manager...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.