previewing *current* report only

L

lucille

hi, i'm no fundi on access - *especially* when it comes to things like
expressions and macros.

I've adapted a template database to suit my personal needs of a client
database. Everything works fine. I've created a report to print from the form
which contains all the client's information. I've got an icon on the form
which takes me to a print preview window, in which i can view the report.
However instead of just previewing the CURRENT report (ie the report for the
form i'm currently working on), the preview includes every single client
already on the database, and politely arranges them alphabetically. So before
i can even view my report, i've got to first hunt it down amongst the dozens
of others.

How can i just view the current report, when clicking on the preview option?
 
B

Brendan Reynolds

lucille said:
hi, i'm no fundi on access - *especially* when it comes to things like
expressions and macros.

I've adapted a template database to suit my personal needs of a client
database. Everything works fine. I've created a report to print from the
form
which contains all the client's information. I've got an icon on the form
which takes me to a print preview window, in which i can view the report.
However instead of just previewing the CURRENT report (ie the report for
the
form i'm currently working on), the preview includes every single client
already on the database, and politely arranges them alphabetically. So
before
i can even view my report, i've got to first hunt it down amongst the
dozens
of others.

How can i just view the current report, when clicking on the preview
option?


Here's an example from a current project ...

Private Sub cmdPrint_Click()

DoCmd.OpenReport "Buddies", acViewPreview, , "BuddyID=" & Me!BuddyID

End Sub

In this example "Buddies" is the name of the report, and "BuddyID" is the
name of the primary key field that uniquely identifies the record. For more
details, see the help topic on the OpenReport method. Here's a link to the
on-line help topic ...

http://msdn2.microsoft.com/en-us/library/bb238032.aspx
 
J

Jeff Boyce

The answer, of course, depends on what you mean by "current report". I
suspect that Brendan has answered your question by providing a mechanism for
you to view the report of the record currently displayed in the form you are
looking at. This should work well if you are using a "single form", but I'm
not so sure of the results if you are using a continuous form...

Good luck!

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

lucille said:
hi, i'm no fundi on access - *especially* when it comes to things like
expressions and macros.

I've adapted a template database to suit my personal needs of a client
database. Everything works fine. I've created a report to print from the form
which contains all the client's information. I've got an icon on the form
which takes me to a print preview window, in which i can view the report.
However instead of just previewing the CURRENT report (ie the report for the
form i'm currently working on), the preview includes every single client
already on the database, and politely arranges them alphabetically. So before
i can even view my report, i've got to first hunt it down amongst the dozens
of others.

How can i just view the current report, when clicking on the preview
option?
 
B

Brendan Reynolds

Jeff Boyce said:
The answer, of course, depends on what you mean by "current report". I
suspect that Brendan has answered your question by providing a mechanism
for
you to view the report of the record currently displayed in the form you
are
looking at. This should work well if you are using a "single form", but
I'm
not so sure of the results if you are using a continuous form...


Well ... there's only one current record in a continuous form, Jeff, so the
result is the same regardless of whether the form is a single record or
continuous form - the current record is printed.

Whether that is in fact the desired result is of course a valid question.
:)
 
J

Jeff Boyce

Thanks, Brendan. I hadn't run through that scenario before, so I wasn't
sure if the issues that have cropped up in continuous forms extended to this
area also...

Regards

Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top