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_Click
DoCmd.DoMenuItem 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_Click:
Exit Sub
Err_Command1_Click:
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_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmStudentTEMP"
stLinkCriteria = "[StudentID]=" & Me![StudentID]
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command2_Click:
Exit Sub
Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click
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.OpenReport"
You may also want to edit this to add the "acViewPreview" 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_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "YourReportNameHere" '<<<----- You'll need to change this!
stLinkCriteria = "[StudentID]=" & Me![StudentID]
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria '<<<----
I changed "OpenForm" to "OpenReport"
'and added the "acViewPreview" parameter for you here
Exit_Command2_Click:
Exit Sub
Err_Command2_Click:
MsgBox Err.Description
Resume Exit_Command2_Click
End Sub
******************************************
--
HTH,
Don
=============================
Use
My.Name@Telus.Net 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:rs5cd0t19aj1k7b7p8diqa99mntki8li6h@4ax.com...[color=blue]
> 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.
>[/color]