Hi There,
I am a new user to Access 2003 and I have created a command button on my form to print the report version of the form. I want only the current record to print when the user clicks on the print button.
I've created the Macro, but in the Where Condition (of the Macro) I can NOT figure out for the life of me on how to restrict to print only the current record..
I know this sounds probably very 1st grader to most you, but I can not figure it out!!!! Can anyone out there help?????????????
Thank you VERY much for taking the time to read this...
Hope you are all having a great day.
7 1399
Hi There,
I am a new user to Access 2003 and I have created a command button on my form to print the report version of the form. I want only the current record to print when the user clicks on the print button.
I've created the Macro, but in the Where Condition (of the Macro) I can NOT figure out for the life of me on how to restrict to print only the current record..
I know this sounds probably very 1st grader to most you, but I can not figure it out!!!! Can anyone out there help?????????????
Thank you VERY much for taking the time to read this...
Hope you are all having a great day.
You don't have to bother with either a Macro or a WHERE condition. If the Reports is based on a Query, and you only want to Print the Report for the Current Record being shown on the Form:
__1. In the underlying Record Source (Query) for your Form, set a Criteria on the Primary Key Field equal to: - [Forms]![<Your Form Name>]![< Your PrimaryKey Field>]
Be sure the Primary Key Fields exists on the Form. Now, in the Click() Event of a Command Button on the Form: - DoCmd.OpenReport "<Your Report Name>", acViewPreview, , , acWindowNormal
Thank you very much!!! Appreciate your help!!
Have a great day.
Thank you very much!!! Appreciate your help!!
Have a great day.
Glad I could help.
Hi there,
I was just going over your last post to my question.
The form that I put the command print button on is not based on a query, it is based on a table. Does that matter? Right now the code for the print button reads the below:
Private Sub Print_Rpt_Cmd_Button_Click()
On Error GoTo Err_Print_Rpt_Cmd_Button_Click
Dim stDocName As String
stDocName = "Rpt_Updated_Alumni_Summry"
DoCmd.OpenReport stDocName, acNormal
Exit_Print_Rpt_Cmd_Button_Click:
Exit Sub
Err_Print_Rpt_Cmd_Button_Click:
MsgBox Err.Description
Resume Exit_Print_Rpt_Cmd_Button_Click
End Sub
BUT, this print the whole report and I only want it to print the current record from the report (not the form). The button is on the form.....
Thanks for any help or advice you can give me!!!
Hi there,
I was just going over your last post to my question.
The form that I put the command print button on is not based on a query, it is based on a table. Does that matter? Right now the code for the print button reads the below:
Private Sub Print_Rpt_Cmd_Button_Click()
On Error GoTo Err_Print_Rpt_Cmd_Button_Click
Dim stDocName As String
stDocName = "Rpt_Updated_Alumni_Summry"
DoCmd.OpenReport stDocName, acNormal
Exit_Print_Rpt_Cmd_Button_Click:
Exit Sub
Err_Print_Rpt_Cmd_Button_Click:
MsgBox Err.Description
Resume Exit_Print_Rpt_Cmd_Button_Click
End Sub
BUT, this print the whole report and I only want it to print the current record from the report (not the form). The button is on the form.....
Thanks for any help or advice you can give me!!!
You must base the Report in order for this to work correctly. It is a simple matter to create a Query that parallels the Table.
How do I base the report from a query? Sorry Im a little confused..
How do I base the report from a query? Sorry Im a little confused..
- Query ==> New ==> Design View ==> Select Table Report is based on.
- Drop all Fields from the Table onto the Query Grid.
- Set the criteria on the 1 Field as previously shown
- Name the Query
- In the properties of the Report, set the Control Source = the Query you just created.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Kevin S. |
last post by:
What's the easiest way for me to launch a simple DOS command "copy filename
to filename" from Access 2000? I have tried in a macro and can't figure it
out.
I'll search the archives, but if...
|
by: Pete |
last post by:
In Access 95/97 I used to be able to create pull down menus (File,Edit
...) from a macro. It seems there used to be some wizard for that.
However in Access 2000 it seems you have to build your...
|
by: Ann Baker |
last post by:
I had to take a Access 97, 2002 and 2003 test for a temp agency. One
of the questions was to "filter the hospital macro to show only the
hospitals associated with hospital ID #" Can't remember the...
|
by: marty3d |
last post by:
Hi!
I'm trying to create one query by combining several smaller UPDATE,
INSERT and DELETE queries. I know this is easily done in SQL Server
using GO, but I can't figure out how to do it in...
|
by: kkrizl |
last post by:
I have an Access database that has a few huge tables. It was taking
about 20 minutes per table to import them from another application. I
used the upsize wizard to put them in a SQL server...
|
by: eskara |
last post by:
I want to set a macro in a database to run when someone tries to Paste Append information into my Description table. Item # is set as the primary key in this database. The macro should look at the...
|
by: alphablackwolf |
last post by:
At work I have a form that we enter data from access into, and then fax out. I have to base any code I do off of the form itself, so I cannot create the form from access.
What I want to do is...
|
by: sphinney |
last post by:
All,
I'm not sure how to adequately explain my problem in two sentences or less, so at the risk of providing TMI, here's the condensed verion.
I have developed an Access 2002 database file that...
|
by: kpfunf |
last post by:
When I email a report via macro or vba code, the attached report is named "Fuel Quote Report.(ext)". I have no idea how this name is used. I have three seperate macros sending three seperate reports....
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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,...
|
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...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |