If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How do I create a button to print a report for a specific record?
I've created a form that users can fill out. I want to include a command
button on the form that prints a report that I've created as well. The problem I'm having is that I can't figure out how to print a report for a single record. Right now, I can only get it to reports for every single record in my database. I've tried to creat a macro to do this, but no luck so far. Any help would be appreciated. |
#2
|
|||
|
|||
On Thu, 26 May 2005 08:08:01 -0700, BANKHR wrote:
I've created a form that users can fill out. I want to include a command button on the form that prints a report that I've created as well. The problem I'm having is that I can't figure out how to print a report for a single record. Right now, I can only get it to reports for every single record in my database. I've tried to creat a macro to do this, but no luck so far. Any help would be appreciated. Your table should have a unique prime key field. If so, code the command button's Click event: DoCmd.OpenReport "ReportName", acViewPreview, , "[RecordID] = " & [RecordID] The above assumes a [RecordID] field that is a Number Datatype. If [RecordID] is Text Datatype, then use: "[RecordID] = '" & [RecordID] & "'" as the Where clause. Change the field name to whatever the actual field name is that you are using. See Access Help files for: Where Clause + Restrict data to a subset of records' -- Fred Please only reply to this newsgroup. I do not reply to personal email. |
#3
|
|||
|
|||
I assume something on the form makes this particular record unique.
If so the in the click of the button add the code DoCmd.OpenReport "Your Report Name", acViewNormal, , "[UniqueID] = " & Me.UniqueID "BANKHR" wrote: I've created a form that users can fill out. I want to include a command button on the form that prints a report that I've created as well. The problem I'm having is that I can't figure out how to print a report for a single record. Right now, I can only get it to reports for every single record in my database. I've tried to creat a macro to do this, but no luck so far. Any help would be appreciated. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Is it possible to show both "Yes" and "No" answers from a "yes/no" checkbox? | Colin Foster | New Users | 28 | March 18th, 2005 02:19 PM |
from a FORM print a label report 3 labels per sheet for CURRENT re | babs | Setting Up & Running Reports | 7 | February 6th, 2005 06:38 PM |
Help!! I'm running around in circles! | CathyA | New Users | 19 | December 12th, 2004 07:50 PM |
Label | SRIT | General Discussion | 2 | June 22nd, 2004 09:42 PM |
How to create a print button. | [email protected] | Setting up and Configuration | 2 | November 5th, 2003 12:17 PM |