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

Help with report / print from form with query??

P: n/a
I have looked on the groups but can't seem to find an answer. I have a
parameter query that uses a form for its input. This form then opens
up a search result form based on the query. It is from this form that
I want to print via a report all of the returned records shown on the
form.

I can print off a single current record shown in the form (say record
3 of 5) using this code:

Private Sub cmdPrintCurrent_Click()
Dim strReportName As String
Dim strCriteria As String
strReportName = "report1"
DoCmd.OpenReport strReportName, acViewPreview, , Wherecondition:="id =
" & Me.id
End Sub

How can I use this as a basis for printing off all of the returned
records on the form from the query?

I am resonable with Access but not that good with VBA (yet!).

Many thanks
Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
What you need is the WHERE clause (criteria) used to open the Form, not the
current record's ID. Where you would find that and how you would use it will
depend on the exact method you used to open the Form. If you used the Where
Condition or Filter of DoCmd.OpenForm, you may find the criteria you need in
the current Form's Filter property. If that's not the case, clarify and
someone will likely have a suggestion for you.

Larry Linson
Microsoft Access MVP
"Aftershock" <ra*****@jameswhittaker.com> wrote in message
news:a5**************************@posting.google.c om...
I have looked on the groups but can't seem to find an answer. I have a
parameter query that uses a form for its input. This form then opens
up a search result form based on the query. It is from this form that
I want to print via a report all of the returned records shown on the
form.

I can print off a single current record shown in the form (say record
3 of 5) using this code:

Private Sub cmdPrintCurrent_Click()
Dim strReportName As String
Dim strCriteria As String
strReportName = "report1"
DoCmd.OpenReport strReportName, acViewPreview, , Wherecondition:="id =
" & Me.id
End Sub

How can I use this as a basis for printing off all of the returned
records on the form from the query?

I am resonable with Access but not that good with VBA (yet!).

Many thanks

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.