473,386 Members | 1,621 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,386 software developers and data experts.

Access Filter Report with Field Name

I currently have a report that summarizes my data for each client from the table (each page summarizes the information for each client). I have VBA code all set that can filter each client and print it to PDF (using ScanSoft), however, my issue is that it prints/saves it using the same name as the original file. In the end, I will need a separate file or report for each client. I am looking for a better and more efficient way of doing so rather than manually creating a new report for each client using the filter option and saving it with a new name.

Currently, my code is as follows:
Expand|Select|Wrap|Line Numbers
  1. DoCmd.OpenReport ("I# Report"), acViewPreview, , "[Carrier Report].[I#]=10936"
  2.  
In this example, it filters 1 client but when it saves it to PDF, it's saving it as "I# Report".

Any thoughts??
Oct 6 '11 #1
3 2645
patjones
931 Expert 512MB
How many clients are we talking about? It almost seems more laborious to manage a different file for each client as opposed to having just one file where it's one client to each page.

If this is what you really need to do though, the approach that I would take is to populate a recordset with each client ID, and then setup a loop that goes through that recordset and runs the OpenReport action for each client. How does this sound to you?

Pat
Oct 6 '11 #2
My main problem is saving it with the client's ID in the the name. The OpenReport would be fine with just opening the report and filtering it on a specific client.
Oct 6 '11 #3
NeoPa
32,556 Expert Mod 16PB
We have a problem with your posted code. See When Posting (VBA or SQL) Code.

That said, we can probably guess what it really looks like. I would suggest something like (where txtClient is the control on the form that contains the client number) :

Expand|Select|Wrap|Line Numbers
  1. Call DoCmd.OpenReport(ReportName:="I#" & Me.txtClient & " Report", _
  2.                       View:=acViewPreview, _
  3.                       WhereCondition:="[Carrier Report].[I#]=" & Me.txtClient)
Oct 6 '11 #4

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

Similar topics

3
by: MT 2MB | last post by:
I created an access journal entry program many years ago. It works for all and was working for an individual until recently. The report shows ?Name! for every instance it repeats in the report. ...
4
by: Zenon | last post by:
I am attempting to append a string prefix to a report field which is based on a query result. I want the user to be able click a checkbox on the form which opens the report to determine whether...
11
by: James P. | last post by:
Hello, I have a report with the Priority field is used as sort order and grouping. The problem is the data in this Priority field if sorted in ascending order is: High, Low, and Medium. How...
2
by: LoopyNZ | last post by:
Hi, (Access 97) I'm creating a query (QRY_SUMMARY) to join a query (QRY) to itself (QRY_1). I'm returning QRY.* and selected fields from QRY_1. With each field (field_name) I return from...
3
by: Daron | last post by:
Is it possible to use a parameter as the field name, not just a criteria? Snippet of my SQL: SELECT Eval("!!.(0)") AS TestField, AS from qry_main The parameter will hold the name of the...
12
klarae99
by: klarae99 | last post by:
Hi everyone, I am new to Access 2003 (though my time on scripts has helped alot) and am creating an inventory database. In my original table design I had a field tblTrans.Date which I was advised to...
2
by: blackduck603 | last post by:
Hi, I am fairly new to Access programming and Reports. I have inherited a project and am trying to understand some of the inner workings. There is a field named Overall in the Detail section of my...
4
by: juanchodavid | last post by:
Hi, I'm having this problem, seems no big deal but I just don't find the way to solve it: I have a field in a form where the user writes a filter criteria and then accepts by pressing a button. The...
7
by: Ares6881 | last post by:
This error has been driving me a little bit nuts, I have 2 reports going off the same query, the query pulls in data from a crosstab query. One of the reports is working just fine, but whenever I...
3
by: sierra7 | last post by:
Hi, I have a report that displays the correct data in Preview but displays #Name? when printed. (Access 2003) The field is unbound but the control source is read from a form =!. & " (Week " &...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
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...
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: 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
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...

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.