Solved

Print Current Record in form to a report

Posted on 1998-01-10
2
423 Views
Last Modified: 2008-03-17
I wish to place a button on my form to print a report of the current record shown on the form.  The main form is from a table and the subform is a query, all works fine, the report is fine.  I currently use a query parameter prompt (dialog box) to ask for the current ID field.  I wish to by-pass this step to simple click a button to first preview the report prior to printing, and/or perhaps a second option to print the report without previewing.

Thanks in advance.
0
Comment
Question by:DWB
2 Comments
 
LVL 5

Accepted Solution

by:
cekman earned 50 total points
ID: 1965103
Let's say the record on your form is for a particular customer with field name CustID. Then - when the user presses the button you do an open report with linkcriteria. For example on the code for the button:

dim LinkCriteria as string

LinkCriteria = "[CustID] = " & me![custID]
docmd.openreport "REPORTNAMEHERE",acPreview,,Linkcriteria

or to go directly to printer:
docmd.openreport "REPORTNAMEHERE",acNormal,,Linkcriteria


Hope this helps
CEkman
0
 

Author Comment

by:DWB
ID: 1965104
Many Thanks
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question