473,569 Members | 2,929 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Selecting only one page out of a several-page report for printing - how to route in Access?

I hope someone will tell me how to do this without having to do any VB
as I know nothing in that area. I am a rank beginner in using Access.

I have created a database consisting of student athletes. *I have now
learned how to join two different tables in a query so that I might
generate a report.

Specifically, student athletes at a community college are required to
graduate with an AA or AS degree. *Consequently, various steps are in
place to ensure they are in compliance. *In this database, one
specific table is dedicated to their following the steps necessary. *

The report generated from this query is several hundred pages long.
*Other than slowly going through each page of the report to find a
specific student and then only printing that one page (by using cntl-p
and then selecting the specific page for that specific student), how
can I selectively print one page only through a query / report format?
*

If that is not possible, what can I do without having to modify code
anyplace? *

TIA.

Nov 13 '05 #1
4 4709
You can do this manually by using the Student's unique identifier, probably
a student id code, as criteria for the query, so as to print the report only
for a single student. With minimal VBA code, you can create the
WhereCondition argument for a DoCmd.OpenRepor t statement to allow the user
to choose the student from a form and report just the one student.

Larry Linson
Microsoft Access MVP

<Sami> wrote in message news:rs******** *************** *********@4ax.c om...
I hope someone will tell me how to do this without having to do any VB
as I know nothing in that area. I am a rank beginner in using Access.

I have created a database consisting of student athletes. I have now
learned how to join two different tables in a query so that I might
generate a report.

Specifically, student athletes at a community college are required to
graduate with an AA or AS degree. Consequently, various steps are in
place to ensure they are in compliance. In this database, one
specific table is dedicated to their following the steps necessary.

The report generated from this query is several hundred pages long.
Other than slowly going through each page of the report to find a
specific student and then only printing that one page (by using cntl-p
and then selecting the specific page for that specific student), how
can I selectively print one page only through a query / report format?
If that is not possible, what can I do without having to modify code
anyplace?

TIA.

Nov 13 '05 #2
Hi Sami,

I can think of a couple of approaches just off the top of my head -- that
should be possible to make using wizards, mostly.

Method #1.) -- Not neccesarily the best choice, but it is the easiest ...
IMHO.
----------------------------------------------------------------------------
--
a.) Create a form based on the same query as the report, so that the desired
students are included in the forms recordset.
b.) Create a combo-box in the form's header section using a similarly
filtered query that will be used to find the desired student. (Use the "Find
a record on my form" option in the combo-box wizard)
c.) Create a command button that prints just the current record. ("Record
operations" / "Print Record")
d.) The button wizard will generate code that looks like this, which should
work "as-is":
*************** *************** ************
Private Sub Command1_Click( )
On Error GoTo Err_Command1_Cl ick
DoCmd.DoMenuIte m acFormBar, acEditMenu, 8, , acMenuVer70 ' This selects
the current record.
'There is a better way to select the current record, but I won't get
into that just now. :-)

DoCmd.PrintOut acSelection ' This prints out the selected record

Exit_Command1_C lick:
Exit Sub

Err_Command1_Cl ick:
MsgBox Err.Description
Resume Exit_Command14_ Click

End Sub
*************** *************** ************

Method #2) -- Involves a little more work, and possibly a lot of confusion
for a newbie... so I'll try to explain it fairly thoroughly. I do think
you'd be most happy with the results produced using this method.
----------------------------------------------------------------------------
--
a & b) as above
c.) Create another form (temorarily) that is also based on a table which
includes the students. This does not need to be filtered by acheivement, but
it has to have the "StudentID" (if that's what youhave named it) For the
sake of this example, close and save this form as "frmStudentTEMP "
d.) Create a command button that opens "frmStudentTEMP " and displays the
same record. (My intent here is to create, then modify the code generated by
the wizard so that it opens your existing report instead of the temporary
form.)
e.) Use "Form Operations" / "Open Form" [Next]
Select "frmStudentTEMP " from the list. [Next]
"Open the form and find specific data to display" {Next]
Select "StudentID" as the field from both list-boxes, and click the
"[<->]" button, then [Next]
Follow the prompts and make choices as you like, then click [Finish] at
the end.

f.) The wizard-generated code should look something like this:
*************** *************** ************
Private Sub Command2_Click( )
On Error GoTo Err_Command2_Cl ick

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmStudentTEMP "

stLinkCriteria = "[StudentID]=" & Me![StudentID]
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command2_C lick:
Exit Sub

Err_Command2_Cl ick:
MsgBox Err.Description
Resume Exit_Command2_C lick

End Sub
*************** *************** ************
All that remains to do now is to edit the generated code ...
Change the "stDocName = " statement, replacing "frmStudentTEMP " with the
name of your report.
You'll also have to change "DoCmd.OpenForm " to "DoCmd.OpenRepo rt"
You may also want to edit this to add the "acViewPrev iew" paramaeter,
inserting it between the first and second commas.
You could go ahead and delete the temporary form at this point, as long as
the report opens correctly.
Then I think you're "good to go"!

*************** ******( revised code example )************** *******
Private Sub Command2_Click( )
On Error GoTo Err_Command2_Cl ick

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "YourReportName Here" '<<<----- You'll need to change this!

stLinkCriteria = "[StudentID]=" & Me![StudentID]
DoCmd.OpenRepor t stDocName, acViewPreview, , stLinkCriteria '<<<----
I changed "OpenForm" to "OpenReport "
'and added the "acViewPrev iew" parameter for you here

Exit_Command2_C lick:
Exit Sub

Err_Command2_Cl ick:
MsgBox Err.Description
Resume Exit_Command2_C lick

End Sub
*************** *************** ************

--
HTH,
Don
=============== ==============
Use My*****@Telus.N et for e-mail
Disclaimer:
Professional PartsPerson
Amateur Database Programmer {:o)

I'm an Access97 user, so all posted code
samples are also Access97- based
unless otherwise noted.

Do Until SinksIn = True
File/Save, <slam fingers in desk drawer>
Loop

=============== =============== ==

<Sami> wrote in message news:rs******** *************** *********@4ax.c om...
I hope someone will tell me how to do this without having to do any VB
as I know nothing in that area. I am a rank beginner in using Access.

I have created a database consisting of student athletes. I have now
learned how to join two different tables in a query so that I might
generate a report.

Specifically, student athletes at a community college are required to
graduate with an AA or AS degree. Consequently, various steps are in
place to ensure they are in compliance. In this database, one
specific table is dedicated to their following the steps necessary.

The report generated from this query is several hundred pages long.
Other than slowly going through each page of the report to find a
specific student and then only printing that one page (by using cntl-p
and then selecting the specific page for that specific student), how
can I selectively print one page only through a query / report format?
If that is not possible, what can I do without having to modify code
anyplace?

TIA.

Nov 13 '05 #3
This sounds easy enough. How and where (very specifically how and
where!) would I do it?

On Mon, 21 Jun 2004 02:10:43 GMT, "Larry Linson"
<bo*****@localh ost.not> wrote:
You can do this manually by using the Student's unique identifier, probably
a student id code, as criteria for the query, so as to print the report only
for a single student. With minimal VBA code, you can create the
WhereConditi on argument for a DoCmd.OpenRepor t statement to allow the user
to choose the student from a form and report just the one student.

Larry Linson
Microsoft Access MVP

<Sami> wrote in message news:rs******** *************** *********@4ax.c om...
I hope someone will tell me how to do this without having to do any VB
as I know nothing in that area. I am a rank beginner in using Access.

I have created a database consisting of student athletes. I have now
learned how to join two different tables in a query so that I might
generate a report.

Specifically, student athletes at a community college are required to
graduate with an AA or AS degree. Consequently, various steps are in
place to ensure they are in compliance. In this database, one
specific table is dedicated to their following the steps necessary.

The report generated from this query is several hundred pages long.
Other than slowly going through each page of the report to find a
specific student and then only printing that one page (by using cntl-p
and then selecting the specific page for that specific student), how
can I selectively print one page only through a query / report format?
If that is not possible, what can I do without having to modify code
anyplace?

TIA.


Nov 13 '05 #4

Wait wait wait wait wait wait......

If not already the case, base you report on a query rather than directly
on a table. Then, in the query designer enter a criteria for the
Student ID. Criteria is entered on the forth ROW down of the StudentID
column. Have a look you'll see what I mean.

In this cell of the grid enter this:

=[Enter a Student ID]

Then when you run the report, you will be asked (strangely) to 'Enter a
Student ID', type in the Student ID you wish to report on and that
student should then be the only one displayed.

You can get trickier if you like and open the report from a button on a
form STILL without entering any VB code.

If you care to know more just reply and ask.
Cheers
Mr. Smith.
Sami wrote:
This sounds easy enough. How and where (very specifically how and
where!) would I do it?

On Mon, 21 Jun 2004 02:10:43 GMT, "Larry Linson"
<bo*****@localh ost.not> wrote:

You can do this manually by using the Student's unique identifier, probably
a student id code, as criteria for the query, so as to print the report only
for a single student. With minimal VBA code, you can create the
WhereConditio n argument for a DoCmd.OpenRepor t statement to allow the user
to choose the student from a form and report just the one student.

Larry Linson
Microsoft Access MVP

<Sami> wrote in message news:rs******** *************** *********@4ax.c om...
I hope someone will tell me how to do this without having to do any VB
as I know nothing in that area. I am a rank beginner in using Access.

I have created a database consisting of student athletes. I have now
learned how to join two different tables in a query so that I might
generate a report.

Specifically , student athletes at a community college are required to
graduate with an AA or AS degree. Consequently, various steps are in
place to ensure they are in compliance. In this database, one
specific table is dedicated to their following the steps necessary.

The report generated from this query is several hundred pages long.
Other than slowly going through each page of the report to find a
specific student and then only printing that one page (by using cntl-p
and then selecting the specific page for that specific student), how
can I selectively print one page only through a query / report format?
If that is not possible, what can I do without having to modify code
anyplace?

TIA.

Nov 13 '05 #5

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

Similar topics

12
1867
by: mpinsley | last post by:
We are a software company that provides Inventory & Procurement mangement to the hospitality industry. For the past twenty years we have been using Progress Software as both the development language and the underlying database. We are in the process of exploring new languages to write our application in, as Progress is becoming expensive for...
3
2405
by: PW | last post by:
I use a multi-select menu in an ASP so the user can pick several values. <select multiple name="lbErrorType" size="12"> However, after I have saved the records to the DB, and the user comes back to edit a prior record, I re-populate the multiple select box and do a "<option selected>" for each record that is saved to the DB. <option...
2
2059
by: John | last post by:
Hello, I have a table called BUILDREQUESTS which I want to select from, depending on the project ID of each record. The Project ID field is indexed. (A) This query runs almost instantly: SELECT BR.REQID FROM BUILDREQUESTS BR WHERE BR.PROJECTID IN...
1
2556
by: Ramesh | last post by:
hi, I am selecting fields from three table for manupulating data and i want to display total number of records selected. But i am always getting -1 value, eventhough 1000 of records are selected. Below is my code. here strSelectSQL value is strSelectSQL = "Select emp.Empno, emp.FirstName, emp.LastName, emp.DB,...
1
3396
by: Bob Geltz | last post by:
I am able to populate a ListView with several detail lines (several columns). When finished, I would like to pre-select the first item in the list (before the user interacts with the list). This way, if a user clicks on the OK button, there will be a default selection. I know how to use ListView.SelectedItems to get the selection, I just...
3
15708
by: larry mckay | last post by:
anyone have the code to select and listview item or row (subitems) after a doubleclick event from a listview. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
1
1389
by: DiTieM | last post by:
I would like to make a call to <xsl:apply-templates select="nodes with the same name"/>. To understand this better, we could think about email. In an email box there are several emails from several users. When clicking in "Order by Date" or "Order by Name" all emails are grouped by that "attribute". I would exactly
22
1973
by: Ramon F Herrera | last post by:
My goal is to study (in the RMS sense) and familiarize myself with some OSS code, until I reach the point at which I can make non-trivial modifications to it. The class of applications I have in mind are almost always written in C and run on Unixes. Historically, I have used a terminal emulator, vi, and gcc/gdb for this type of project, but...
4
1361
by: Danny | last post by:
Hi all, So I have these tables of items and item-types, and the items can be of several types: Items: ID ; Name 1 ; Item1 2 ; Item2
7
4648
by: swami | last post by:
What is the query for selecting non duplicate elements for eg: no name age 1 siva 28 2 blair 32 3 mano 28 i want to select blair which hasn't got any duplicate elements in age
0
7933
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8142
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7989
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6306
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5238
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3670
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2123
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.