473,396 Members | 1,816 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Print Single record vs whole report

I have a report that prints all of the records out from a table, usually executed from a reports menu. The user also wants a print button on the data entry form that will print out the exact same report but only for that record. Is there trick so I can use the report but limit it to printing out the single record?
Apr 1 '10 #1

✓ answered by ADezii

You can accomplish this by setting the WHERE Condition of the OpenReport Method to point to the Current Record. The following code, executed from an Employees Form, will Print a single Record reflecting the currently displayed Employee. This is done by passing the [EmployeeID] (Primary Key) to the WHERE Argument so that the Report reflects only a single Employee.
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "rptEmployees", acViewNormal, , "[EmployeeID] = " & Me![EmployeeID], acWindowNormal

2 3154
ADezii
8,834 Expert 8TB
You can accomplish this by setting the WHERE Condition of the OpenReport Method to point to the Current Record. The following code, executed from an Employees Form, will Print a single Record reflecting the currently displayed Employee. This is done by passing the [EmployeeID] (Primary Key) to the WHERE Argument so that the Report reflects only a single Employee.
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport "rptEmployees", acViewNormal, , "[EmployeeID] = " & Me![EmployeeID], acWindowNormal
Apr 1 '10 #2
Thanks! I was trying to do it through the reports open event and getting nowhere
Apr 2 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: al | last post by:
Hi I need to automaticaly print new records/reports in an Access database to a labelprinter. Can this be done? The records are added with asp code. The Labelprinter is a Brother QL-550 ...
10
by: Fendi Baba | last post by:
I am new to MS Access so please bear with me. I am trying to create a report format and attach a button to a form. This would users to print-out a record that they are looking at. I can report a...
2
by: mgolding | last post by:
I have an Access query that gets an ID value from an open form. Something like SELECT * from tablename WHERE ID=openFormName.ID; But now, I want to also run the query by handing it the ID from...
22
by: RayPower | last post by:
I'm having problem with using DAO recordset to append record into a table and subsequent code to update other tables in a transaction. The MDB is Access 2000 with the latest service pack of JET 4....
2
by: aro818 | last post by:
Hi I am creating a microsoft database and am currently stuck. I need to print one record at a time when in form view. to do so, I need to create a script which uses a value in the table which is a...
6
by: jweaver | last post by:
I have set up an event to print a single record report in access with the criteria below, however each time I enter a claim ID to preview a report, I am able to see the correct claim ID but the...
0
by: AmateurDBer | last post by:
Hello, I'm looking for Allen. I hate to bother you again, but I am now trying to e-mail the single record from the same form mentioned before (using a macro button) (reference thread about...
2
by: Greg (codepug | last post by:
acCmdPrint allows me to print using the Windows Dialog. Since I want to be able to select the printer of my choice, this works well. I put his behind a button on a single form. The problem is,...
2
by: Giggly | last post by:
I have an access database and I have a macro in it that has the folowing commands: GotoRecord - Next OpenReport - Report Name: Single Receipt - View: Print I want the OpenReport to print...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.