473,395 Members | 2,795 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,395 software developers and data experts.

Generate report for different departments in a list

Hi,

I have a department list query called qryDepartment. A report is
designed called rptException based on query qryException. I need to run
this report for each department in qryDepartment. The field name for
the department is fldDepartment

Can some kind soul help me with a code which I can attach to the On
Click event of a button such that reports with name Department.pdf are
created (I have Adobe Professional) and save to a directory Z:\Reports

Please let me know if I have omitted info which may be required to
assist.

TIA.

Ninad.

Nov 13 '05 #1
2 1339
hmm... so you need to run this for each department in the query.

Easiest way is probably to open a recordset based on the query, and
hten to open the report with that filter. Then you can do whatever
with the data.

something like

dim qdf as querydef
dim rst as dao.recordset
set qdf = currentdb.querydefs(strQueryName)
set rst=qdf.openrecordset
do until rst.eof
docmd.openreport "reportname", "[somefield]='" &
rst.fields("MyField") & "'"
docmd.printout
Docmd.Close "reportname",acREport
rst.movenext
loop

Hope this points you in the right direction...

Nov 13 '05 #2
Thanks. Once I resume office, I'll try out the above and post my
success/failure.

Ninad.

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

137
by: Philippe C. Martin | last post by:
I apologize in advance for launching this post but I might get enlightment somehow (PS: I am _very_ agnostic ;-). - 1) I do not consider my intelligence/education above average - 2) I am very...
1
by: dan_williams | last post by:
I am attempting to create a ASP.NET report whereby users can specify which columns they wish to be able to view depending on the options they select from a CheckBoxList. I have 4 tables,...
2
by: PeterW | last post by:
I have an xml file from which I want to generate an xsd schema and at a later stage a cs class. The xml file has a mix of defined namespaces and also an empty namespace. These are defined as...
1
by: Andy_Khosravi | last post by:
I'm having trouble building a query to gather the information I need from a table. I need to be able to assemble an inventory report that displays receipts, output, and running inventory from a...
0
by: ward | last post by:
Greetings. Ok, I admit it, I bit off a bit more than I can chew. I need to complete this "Generate Report" page for my employer and I'm a little over my head. I could use some additional...
10
by: kaosyeti | last post by:
hey... i have a report whose detail section is based on three departments so the report is 3 pages for that, plus two pages for a report footer and a cover page report header. if the three...
1
by: colemanj4 | last post by:
Hello, I have a query that gives me a list of departments, a list of Actions Types and a percentage. I would like to get it into a report that has the Departments listed down the left side, the...
2
by: Shailja | last post by:
Hello, I have developed Drug Management Software in VB. Now I want to generate one report showing the list of all medicine name, Qty, Expiry Date etc. using Crystal Report. Format would be...
2
by: herbiegrey | last post by:
Hello This is my first post on the forum so hello everyone. I have a problem with access that I can't manage to view the current form record as a report ready to be printed. I have a list...
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: 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...
0
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...
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
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.