Printing Report for one a single record - Several problems

Guys, I am having several issues here.  Please be patient with me. 
I have a form named : Evaluation Form
I have a report named : Evaluation
The table is named: Evaluation

What I am wanting to do is click the Print button on a form where I have 
entered data and print a single record off of a report that is linked to the 
data.

I have a button named 'Print1' on the form.  I have tried the code several 
different ways and come to different problems each time I change it.  
---------------------------------------------------------------------------
"This will get me a dialog box asking for a parameter."
The code I added to the button is as follows:

Private Sub Print1_Click()
DoCmd.OpenReport "Evaluation", acPreview
Reports![Evaluation].Filter = "Officer = " & Me![Officer]
Reports![Evaluation].FilterOn = True
End Sub
______________________________________________________________
"This gets me an error in the debug of 'cant find the field 'ID' in the 
expression."
I tried this code:

Private Sub Print1_Click()
DoCmd.OpenReport "Evaluation", acPreview
Reports![Evaluation].Filter = "ID = " & Me![ID]
Reports![Evaluation].FilterOn = True
End Sub

--------------------------------------------------------------------------------------
0
Utf
1/29/2010 9:13:01 PM
access 16762 articles. 3 followers. Follow

5 Replies
685 Views

Similar Articles

[PageSpeed] 43

You don't apply the filter after you open the report.  You have to
specify it WHEN you open the report.  one of the arguments of the Open
event of the report is the filter

Public Sub OpenMyReport()
    Dim strFilter As String
    strFilter = "[EmployeeID] = Forms!frmEmployee!cboEmployeeID"
    DoCmd.OpenReport "EmployeeReport", acViewPreview, , strFilter,
acWindowNormal
End Sub
0
pietlinden
1/29/2010 9:25:31 PM
I don't care much for the Filter property of a report and, instead, I do the 
filtering in the record source of my reports. The syntax for setting the 
criteria in your query would be:

Forms![Evaluation Form]![ID]

-- 
Lynn Trapp
MCP, MOS, MCAS


"NDClark" wrote:

> Guys, I am having several issues here.  Please be patient with me. 
> I have a form named : Evaluation Form
> I have a report named : Evaluation
> The table is named: Evaluation
> 
> What I am wanting to do is click the Print button on a form where I have 
> entered data and print a single record off of a report that is linked to the 
> data.
> 
> I have a button named 'Print1' on the form.  I have tried the code several 
> different ways and come to different problems each time I change it.  
> ---------------------------------------------------------------------------
> "This will get me a dialog box asking for a parameter."
> The code I added to the button is as follows:
> 
> Private Sub Print1_Click()
> DoCmd.OpenReport "Evaluation", acPreview
> Reports![Evaluation].Filter = "Officer = " & Me![Officer]
> Reports![Evaluation].FilterOn = True
> End Sub
> ______________________________________________________________
> "This gets me an error in the debug of 'cant find the field 'ID' in the 
> expression."
> I tried this code:
> 
> Private Sub Print1_Click()
> DoCmd.OpenReport "Evaluation", acPreview
> Reports![Evaluation].Filter = "ID = " & Me![ID]
> Reports![Evaluation].FilterOn = True
> End Sub
> 
> --------------------------------------------------------------------------------------
0
Utf
1/29/2010 9:41:01 PM
Lynn, you lost me.  Should I scrap my code? 
If so you say go to the Record Source.  Should I create a query in the 
Record Source of the Report?

"Lynn Trapp" wrote:

> I don't care much for the Filter property of a report and, instead, I do the 
> filtering in the record source of my reports. The syntax for setting the 
> criteria in your query would be:
> 
> Forms![Evaluation Form]![ID]
> 
> -- 
> Lynn Trapp
> MCP, MOS, MCAS
> 
> 
> "NDClark" wrote:
> 
> > Guys, I am having several issues here.  Please be patient with me. 
> > I have a form named : Evaluation Form
> > I have a report named : Evaluation
> > The table is named: Evaluation
> > 
> > What I am wanting to do is click the Print button on a form where I have 
> > entered data and print a single record off of a report that is linked to the 
> > data.
> > 
> > I have a button named 'Print1' on the form.  I have tried the code several 
> > different ways and come to different problems each time I change it.  
> > ---------------------------------------------------------------------------
> > "This will get me a dialog box asking for a parameter."
> > The code I added to the button is as follows:
> > 
> > Private Sub Print1_Click()
> > DoCmd.OpenReport "Evaluation", acPreview
> > Reports![Evaluation].Filter = "Officer = " & Me![Officer]
> > Reports![Evaluation].FilterOn = True
> > End Sub
> > ______________________________________________________________
> > "This gets me an error in the debug of 'cant find the field 'ID' in the 
> > expression."
> > I tried this code:
> > 
> > Private Sub Print1_Click()
> > DoCmd.OpenReport "Evaluation", acPreview
> > Reports![Evaluation].Filter = "ID = " & Me![ID]
> > Reports![Evaluation].FilterOn = True
> > End Sub
> > 
> > --------------------------------------------------------------------------------------
0
Utf
1/30/2010 6:19:01 AM
Does this help?

    How to print only one page of a multipage report
    http://www.access.qbuilt.com/html/reports.html#PrintOnePgOfRpt


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________

"NDClark" wrote:

> Guys, I am having several issues here.  Please be patient with me. 
> I have a form named : Evaluation Form
> I have a report named : Evaluation
> The table is named: Evaluation
> 
> What I am wanting to do is click the Print button on a form where I have 
> entered data and print a single record off of a report that is linked to the 
> data.
> 
> I have a button named 'Print1' on the form.  I have tried the code several 
> different ways and come to different problems each time I change it.  
> ---------------------------------------------------------------------------
> "This will get me a dialog box asking for a parameter."
> The code I added to the button is as follows:
> 
> Private Sub Print1_Click()
> DoCmd.OpenReport "Evaluation", acPreview
> Reports![Evaluation].Filter = "Officer = " & Me![Officer]
> Reports![Evaluation].FilterOn = True
> End Sub
> ______________________________________________________________
> "This gets me an error in the debug of 'cant find the field 'ID' in the 
> expression."
> I tried this code:
> 
> Private Sub Print1_Click()
> DoCmd.OpenReport "Evaluation", acPreview
> Reports![Evaluation].Filter = "ID = " & Me![ID]
> Reports![Evaluation].FilterOn = True
> End Sub
> 
> --------------------------------------------------------------------------------------
0
Utf
1/30/2010 7:40:01 AM
> You don't apply the filter after you open the report.  You have to
> specify it WHEN you open the report. 

Well, one *can* apply a filter after opening the report, but it really 
doesn't make a lot of sense to do so, especially if a network separates you 
from your data. I agree that using the optional WhereCondition parameter 
makes a lot more sense.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________

"pietlinden@hotmail.com" wrote:

> You don't apply the filter after you open the report.  You have to
> specify it WHEN you open the report.  one of the arguments of the Open
> event of the report is the filter
> 
> Public Sub OpenMyReport()
>     Dim strFilter As String
>     strFilter = "[EmployeeID] = Forms!frmEmployee!cboEmployeeID"
>     DoCmd.OpenReport "EmployeeReport", acViewPreview, , strFilter,
> acWindowNormal
> End Sub
0
Utf
1/30/2010 7:42:01 AM
Reply:

Similar Artilces:

Before Update on record select
I am getting no where fast. I have a main form and sub form and what i need is a message to appear when user moves on to the next record using the record selector on the bottom of the form. I have tried the beforeupdate on the form but no results. Can form design prevent a message prompt? One problem is that if no changes to the current record have been changed, the Before Update event will not fire. If you do make a change, the code as is should work. I have gotten into the habbit of not using the standard record navigators, but write my own so I can easily deal with this. -- Dave Ha...

Compare records in a query then write equation??
Hi all, i have a problem and i need help, the case is as follows: the default rule is that i have 4 fields, (Date, Team, Score). each team is allowed to have one score per day but sometimes it can have 2 scores per day, when this is the case i wanna multiply each score by a certain number and have one score instead of 2 scores (similar to average but not average). So, i need to have a condition which compares records, and if this is the case, formulates this equation and gives me one score instead of 2 scores. Please help SELECT Team, [Date], Sum(Score)/Count(Score) * IIF(Count(Score) =1,1,S...

Locked records
I am having a bit of an annoying problem with my Access application. The data is held on a SQL 2000 server with Access front-end. I have a form (Form A) used for editing records, this form is launched from a command button on another form (Form B) and filters to a sepcific records on Form A dependant on the record in Form B. Nothing special here I use this technique all over this application. Form A opens up and displays the record I want but when ever I make a change and try to exit the form or save the record I get the following message: "The record has been changed by another user...

Exchange update problem
I have tried to upgrade exch2k3 sp1 to sp2, but the update fails with "the file pcproxy.dll is in use, and setup cannot identify the app or srvc. setup cannot continue" Any clues/ideas/suggestions? Please. -- ----------------------------------------------------------------------------------------------------------------------- This message has been checked for all known viruses. The information contained in this e-mail and any attachments is confidential and may be the subject of legal, professional or other privilege. It is intended for the named addressee only and may not ...

multiple Domain name delivery problem
hi, I currently have Exchange Server 2003 Build 7638:2 SP2,. We have multiple domain names being delivered to the exchange store. I have nothad any problems, but i currently have one user that is not receiving emails with attachments from one certain "internet" sender to one of her email addresses, but the other address works fine & if they send emails without attachments, everything works fine from either address. I have had the user send them message with attachments to me & the user with the problem & i get the message, but not the other user! I even use message...

SQL deadlock problem
I am currently having a big issue with sql deadlocking on the PrincipalObjectAccess table. The last few months I have been working on a synchronization process using a Biztalk orchestration. The sync uses the crm webservices to create and update account and contact records in CRM. But now deployment to the production environment gives me some problems. It seems that when trying to update account records (which is one of the first actions in the sync process) the webservice gives me Generic SQL errors and SQL timeouts. After extensive profiling and tracing in SQL I found that there are...

Parsing data from one spreadsheet into another format
The data that we dump out of one machine comes in like below. %AT_1300 Bottoms|Conductivity| (Water Out) InputRange VDC1to5 %AT_1300 Bottoms|Conductivity| (Water Out) Custom_Range_Low 0.0 %AT_1300 Bottoms|Conductivity| (Water Out) Custom_Range_Hi 0.0 %AT_1300 Bottoms|Conductivity| (Water Out) MinScale 0.0 %AT_1300 Bottoms|Conductivity| (Water Out) MaxScale 20.0 %AT_1300 Bottoms|Conductivity| (Water Out) EngUnits mhos %AT_1300 Bottoms|Conductivity| (Water Out) StepResponseTime 1.0 %AT_1300 Bottoms|Conductivity| (Water Out) DigFiltTimeCnst 0.016 And I need to convert this data to this f...

docmd.transfertext problem
Hi, I am using access 97 and tried to import a csv file to the mdb table. I run a code as following: DoCmd.TransferText acImportDelim, "Specification4", "input", DEFAULT_PATH & "online.txt", 1 In online.txt, there is a field which is 10 digit number and I specified it as a double datatype in the specification4. After the import, I found out that the 10 digit number data in the field get empty in the destined table while other fields are all right. Therefore I import manually using specification4 instead of running code. This time the 1...

Stupid question regarding reports
I am a former Quicken user switching to Money and I have what seems to me a very dumb report question. How do I create a new report? I've looked in the help file and in the online tutorial and users guide and find plenty of references to customizing an existing report but nothing about creating a new one. I realize that it must be there somewhere. Someone please help this dummy (it would be nice if they gave you even a 5 page manual though). Bob Had me guessing for a while also. Just click on "reports" and select which one you want. Don't forget to use "custom...

how do I connect an object from one page to a different page?
I am trying to connect an object from one page to a seperate object on a different page. The instructions say to hold down your mouse button then click on the point you want it connected too. My problem is that is doesn't allow you to select the starting point of the connector, then select a different page, then click on your end point of the connector. Please help! try using a hyperlink. al "Pepper" <Pepper@discussions.microsoft.com> wrote in message news:3F5657F4-48EA-4681-A21E-D33FC7030401@microsoft.com... >I am trying to connect an object from one page to...

Find prev record on other requeried form
Using access 2003. I have a main form for name and address info. A subform shows limited info on client placement. Click a command button on the main form and user opens another form for full screen entry of placement data. That form opens showing the client selected on the initial main form. When the full screen placement form closes, it requeries the original main form with the placement subform to show the added placement. It goes to the first record in the table though. It does not show the original client whose placement was just added. How do I set the mai...

printing multi page newsletters with publisher 2000
Created a new newsletter in publisher 2000, tried to print it on my Epson Photo R1800 printer which supports up to 13x19 sheet paper and 13"x***' in roll format and could not select a format to print pages 1 and 4 on one side and then 2 and 3 on the other. Downloaded an instruction sheet from Microsoft on printing "two 8.5-by11-inch pages per 11-by-17-inch sheet of paper" It says on "file" click "print", choose a printer that can print on 11x17, then click "Book Printing Option" at the bottom of the dialog box. Problem is this "Bo...

Radar chart in Access 2007 report
Can you add a Radar chart to an access 2207 report? ...

How do I create several NEW templates from start to finish please?
Hi knowledgeable people. I am looking for instructions on how to create a range of basic templates that I can use, perhaps even by selecting them as 'stationery', for example; if I go to >New >Format >Apply stationery, or any other similar method. I can create new html stationery backgrounds, but this is NOT what I am looking for, as a lot of people still read email in plain text only...does this make sense? Plain text templates would be fine. I simply can't find any info on creating email templates anywhere to suit this Windows Live Mail Desktop versio...

Strange Access Denied Problem with Windows 7
I got a new computer about six months ago that came with Windows Vista Home Premium 64bit. Before that I had done all of my .NET development either on an XP Pro VM or my former XP Pro computer at home. Shortly after getting my new computer at home, I also got a license for VMWare to be able to test my software on multiple platforms and configurations. I had wrote an application originally in VB.NET that was a simple backup utility. It supports mutiple backup configurations. Any given copnfiguration would define a backup which would be a list of files to backup, a list of folders to ...

2 register ruinning together on one z report
Is this possible, to have two registers running on one z report ? We have a small store and would like to setup a second register as a backup, temporary addition ( during rush hours) Since we are a small show i do not need to have a separate register reports. Can two registers ring up all sales together as one ? How can i set this up ? No, you can't do that. You might be able to use the Register Analysis report available in SO Manager Utilities/Crystal Reports to get something close to a single Z though. Glenn Adams Tiber Creek Consulting http://www.tibercreek.com glenn@tibercreek.c...

Outlook freezes after sending one email after upgrading 4.0
We just upgraded from 3.0 to 4.0 this weekend. All client machines have had the desktop client upgraded and 2 have the same issue. One is XP with Outlook 2003 and the other is Vista with Outlook 2007. Open opens and the CRM addin initializes correctly. As soon as you compose and send an email, Outlook locks up and you have to kill the process in task manager to close Outlook. I've had the same problem and have tried all I can think of...how did you fix this issue? Thank you. "Sander" wrote: > We just upgraded from 3.0 to 4.0 this weekend. All client machines have...

White Printing
How do I print white text onto black paper? The text just comes out blank when printed. I am using a black background on screen to see what it looks like, then deleting that so I can print in white. On Mon, 12 May 2008 18:46:03 -0700, PJ1980 <PJ1980@discussions.microsoft.com> wrote: >How do I print white text onto black paper? The text just comes out blank >when printed. I am using a black background on screen to see what it looks >like, then deleting that so I can print in white. Interesting. Does your printer have a WHITE ink cartridge? NO? You can't do it. Ther...

Excel Problem
I have a 23.8 meg excel 2000 spreadsheet set for manual calculation saved to my local hard drive. Every time I try to open it, it takes forver and sometimes never opens but I do not get any error messages, let me just tell you that I am running a P4, 1 GB memory, Office 2K with SP3, and nothing else running when I try to open it. As I said it is set for manual calculation, and it is cleared to not auto calculate when opening or closing. Any idea's as to why this is happening? -- Todd I don't know why you're having this problem but I would like to point something out for w...

SOAP Exception
Hi, In my C# code, I have defined a Map object which is sent as part of a request to a web service, here's an extract of the part of the code: - Map map = new Map(); map.item = new mapItem[4] { new mapItem(), new mapItem(), new mapItem(), new mapItem() }; ................. But when I submit the request containing the Map object, the compiler throws an error with the following message:- org.xml.sax.SAXException: No deserializer for {http://xml.apache.org/ xml-soap}...

outputting values to a range from one formula
I wish to generate a table automatically by means of a single formula that applies an iteration on a starting given value with a given step, and the computed values are posted/entered automtically into cells from a given cell onwards, say below it, until the computed value reaches a certain given limt. This is somehow the inverse of INDIRECT or of OFFSET. These can pull values from a variable addresses of cells. What I need is to push values into a variable addresses of cells. Can anyone help me on that?? Thanks. :confused -- Shafe ---------------------------------------------------------...

Automatic incremental of records
I have a table with several records and arranged serially, i.e 1,2,3 .....25. When I delete arecod like record number 3 I would like record number 4 to become record number 3. But in my case Record number 4 still remains serial number 4 although it is actually the third record. Is there a way it can be done automatically? njogus wrote: > I have a table with several records and arranged serially, i.e 1,2,3 > .....25. When I delete arecod like record number 3 I would like > record number 4 to become record number 3. But in my case Record > number 4 still remains serial number ...

Tabs and record scrolling
Hi - I have a combo box that automatically sets the focus of one of 3 tab pages based on the value selected in the combo box. I'd like to be able to do the same thing when scrolling through records. Any help is appreciated!! Steve Hi Steve, Put the same code in the on current event of the form, remembering to check if the combo is null of course!! That way as you change records, it will trigger the event and set the focus as necessary. Damian. "sboegeman" wrote: > Hi - > > I have a combo box that automatically sets the focus of one of 3 tab pages > bas...

Linking information form one worksheet to another
Hi, i have a big problem i want to create a link between some columns in two seperate worksheets, so that when i type a name on the master sheet it would give me the required information.Dont know if i explained this right, lets say on the master sheet i have columns : Name,Sex and Height on columns A,D and BH respectively i want that if i type a person's name in worksheet 2 it should give me the results on columns A,C,F in that worksheet. Please help i need it asap for my director One way .. Assuming your "master" sheet is named: Master, with data in row1 down In Shee...

Border problems
Not sure why all of a sudden all my borders in my tables created with Publisher can only be white. No other color will show when selected. Opening a pub file done on another computer where the borders show color, shows white only. I have attempted to do a repair on publisher, which gave no help. Have attempted to uninstalled and reinstall Publisher without clearing the problem. Anyone have any ideas or suggestions? Look in the Accessibility Options in the control panel, display tab, disable "use high contrast." If that doesn't solve the issue, read the third FAQ here....