Solved

Print Current Record in form to a report

Posted on 1998-01-10
2
397 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Access 2010 3 19
MS Access IsNull Then Compile Error Expected Then or goto WHY????? 6 18
Error in SQL Query 36 39
Dlookup issue 4 16
When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

743 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now