Solved

Print Current Record in form to a report

Posted on 1998-01-10
2
442 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
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 …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

623 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