Solved

Print Current Record in form to a report

Posted on 1998-01-10
2
438 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
SQL Query logic question 14 70
Access Need to add combo box to sub form 10 51
Missing DLL in Access 2010 11 27
Access 2003 query, remove dupes 17 20
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

732 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