473,608 Members | 2,077 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

source selection for reports- help request

I am trying to automate the way reports are printed in an Access 2003
database - I have ~200 records (people) who require between 5 and 10
customized reports (depending on values within certain fields) -
currently I print each report by selecting all employees and printing
one report at a time - once all reports are printed, I manually
collate the packages - I would like to be able to have a combo box (or
other option) highlight the required employees, press one button and
have all related reports print for the first employee, then move on to
the second employee, etc - thus each customized package will be
collated on the printer and all I have to do is add a paper clip.

I would use a combo box that displays all employees alphabetically
showing their name and employee number - once selected their employee
number (primary key) is used to select the report. I have looked at
using a macro to select the list of 10 reports, but do not have enough
experience to know how to code the procedure that will cycle through
the employee's and if they don't meet certain criteria, skip the
printing of certain reports.

I am not a programmer by any means but can generally understand code
and modify canned code to make it suit the tasks but for this project
I have not been able find a sample database that would help me
understand what I need to do.

Any help you can provide would be appreciated.

Thanks.
Jun 27 '08 #1
7 2052
On Fri, 13 Jun 2008 22:46:07 -0700 (PDT), go****@infoland .ca wrote:

I'm voting to save some trees, and email the reports overnight to the
recipients.
How to construct the code depends on the details of your db design.
Hire a competent developer to assist you with that. "Microsoft
Solution Provider" in your yellow pages may be a good place to start.

-Tom.
>I am trying to automate the way reports are printed in an Access 2003
database - I have ~200 records (people) who require between 5 and 10
customized reports (depending on values within certain fields) -
currently I print each report by selecting all employees and printing
one report at a time - once all reports are printed, I manually
collate the packages - I would like to be able to have a combo box (or
other option) highlight the required employees, press one button and
have all related reports print for the first employee, then move on to
the second employee, etc - thus each customized package will be
collated on the printer and all I have to do is add a paper clip.

I would use a combo box that displays all employees alphabetically
showing their name and employee number - once selected their employee
number (primary key) is used to select the report. I have looked at
using a macro to select the list of 10 reports, but do not have enough
experience to know how to code the procedure that will cycle through
the employee's and if they don't meet certain criteria, skip the
printing of certain reports.

I am not a programmer by any means but can generally understand code
and modify canned code to make it suit the tasks but for this project
I have not been able find a sample database that would help me
understand what I need to do.

Any help you can provide would be appreciated.

Thanks.
Jun 27 '08 #2
I know I'm not alone in looking for a solution for a task such as what
I have listed, emailing the reports is not an option as the employee
must sign the paper report... I know basically what is needed will be
like:

For Each Selected Record
Query if the employee requires the report
Print the report for the current record
Next Record

This project is not funded as I work for a government organization and
unless people want to pay more taxes to allow for larger budgets I'm
stuck trying to work through this on my own with any assistance I can
get via the web.

To reduce the resources needed to complete the tasks in my office, I
volunteer my after hours time developing things such as this database
- any useful assistance is greatly appreciated.
Jun 27 '08 #3
It's Canada, right? Let me know which government organization it is
and I'll send a cheque to the Ministry right away! I'm completely
confident that the government and its minions spend every one of my
tax dollars carefully, os if there's not enough, just let me know.

On Jun 14, 3:15*pm, goo...@infoland .ca wrote:
I know I'm not alone in looking for a solution for a task such as what
I have listed, emailing the reports is not an option as the employee
must sign the paper report... I know basically what is needed will be
like:

For Each Selected Record
Query if the employee requires the report
Print the report for the current record
Next Record

This project is not funded as I work for a government organization and
unless people want to pay more taxes to allow for larger budgets I'm
stuck trying to work through this on my own with any assistance I can
get via the web.
Jun 27 '08 #4
go****@infoland .ca wrote:
I am trying to automate the way reports are printed in an Access 2003
database - I have ~200 records (people) who require between 5 and 10
customized reports (depending on values within certain fields) -
currently I print each report by selecting all employees and printing
one report at a time - once all reports are printed, I manually
collate the packages - I would like to be able to have a combo box (or
other option) highlight the required employees, press one button and
have all related reports print for the first employee, then move on to
the second employee, etc - thus each customized package will be
collated on the printer and all I have to do is add a paper clip.

I would use a combo box that displays all employees alphabetically
showing their name and employee number - once selected their employee
number (primary key) is used to select the report. I have looked at
using a macro to select the list of 10 reports, but do not have enough
experience to know how to code the procedure that will cycle through
the employee's and if they don't meet certain criteria, skip the
printing of certain reports.

I am not a programmer by any means but can generally understand code
and modify canned code to make it suit the tasks but for this project
I have not been able find a sample database that would help me
understand what I need to do.

Any help you can provide would be appreciated.

Thanks.

I'll toss out some starter stuff. I might create a table, called
AppReports. It would have 2 fields (or more). RptID type Autonumber
and ReportDescripti on type text. I'd then enter your 10 reports.

I think a combo would not suit your needs. I'd use a listbox.

Since you didn't provide much information I might first create two list
boxes. The first listbox, ListEmployee, would have 2 fields, the
employeeid and the employee name. I'd set it (under data tab) to Simple
or Extended (see help for the difference by pressing F1 on that property
row).

The second listbox, ListReports, would list the Reports from table
AppReports. Set to simple or extended as well.

Then have a command button to print the reports. I don't do macros.

The event procedure for the command button might start off like this

Private Sub CommandReport_C lick()
On Error GoTo Err_CommandRepo rt_Click
Dim varEmp As Variant 'pointer to selected employees
Dim varRpt As Variant 'pointer to selected reports

Dim lngEmpID As Long 'in case you need employee id
Dim strName As String 'in case you need employee name

Dim strReport As String 'var to hold the report name

'cycle thru emp list and printing reports for
'each employee selected.
For Each varEmp In Me.ListEmployee s.ItemsSelected

'1st col is EmpID, 2nd is EmpName
lngEmpID = Me.ListEmployee s.Column(0, varEmp)
strName = Me.ListEmployee s.Column(1, varEmp)

'cycle thru the rpts list, printing each report selected
For Each varRpt In Me.ListReports. ItemsSelected

'get each report name selected to print
strReport = Me.ListReports. Column(1, varRpt)

DoCmd.OpenRepor t strReport

Next varRpt
Next varEmp

Exit_CommandRep ort_Click:
Exit Sub

Err_CommandRepo rt_Click:
MsgBox Err.Description
Resume Exit_CommandRep ort_Click

End Sub
Jun 27 '08 #5
You can build/use the "where" clause, and base the reports sql *without* any
parameters.

So, you can build a un-bound form (a un-bound form is a form that is NOT
attached to a table - these forms are typically designed for user interface
face stuff like prompts, print buttons etc).

The following screen shots are all un-bound forms, and they simply prompt
the user for information.

http://www.members.shaw.ca/AlbertKal.../ridesrpt.html

The above should give you some ideas

So, the solution use now is simply to take the values from the form, and
build your own where clause in code. That way, you simply design the reports
(or forms), and attached them to the query. And, NO FORMS conditions are
placed in the query.

To "send" the conditions to the report (or form), you simply use the "where"
clause. This is exactly why ms-access has this feature...and it solves a
zillion problems...and will reduce your development costs by a substantial
amount.

The code to make those above screens work and launch the report with the
selected restrictions when you hit the "print" button is easy:
dim strWhere as string

' select sales rep combo

if isnull(cboSales Rep) = false then

strWhere = "SalesRep = '" & cboSalesRep & "'"

end if

' select what City for the report

if isnull(cboCity) = false then
if strWhere <"" then
strWhere = strWhere " and "
endif
strWhere = strWhere & "City = '" & cobCity & "'"
end if

Note how the 2nd combo test is setup. You can add as "many" more conditions
you want. Lets say we have a check box to only include Special Customers. We
can add to our very nice prompt screen a check box to

[x] Show Only Special customers

The code we add would be:

if chkSpeicalOnly = True then
if strWhere <"" then
strWhere = strWhere " and "
endif
strWhere = strWhere & "SpecialCus t = true"
endif

For sure, each combo and control we add to the nice report screen takes a
bit of code, but no more messy then the query builder..and this way, each
query is nice and clean, and free of a bunch of HIGHLY un-maintainable
forms! expressions.

Further, it means you can re-use the same query for different reports, and
have no worries about some form that is supposed to be open. So, a tiny bit
more code eliminates the messy query problem.. For me, this is very worth
while trade.

For a date range, we could put two calendar controls on the screen. The code
could be:
dim strWhere as string
dim strStartDate as string
dim strEndDate as string
strStartDtae = "#" & format(me.Start DateContorl,"mm/dd/yyyy") & "#"
strEndDate = "#" & format(me.EndDa teContorl,"mm/dd/yyyy") & "#"

strWhere = "InvoiceDat e is between " & strStartDate & " and " & strEndDate

docmd.openRepor t "InvoiceReport" ,acViewPreview, ,strWhere
--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl************* ****@msn.com
Jun 27 '08 #6
Thank you very much for a solution that looks like it will answer my
problem.
Jun 27 '08 #7
Thanks Albert, your solution will be ideal for dealing with an
enhancement that has been on the back burner as well. Have a great
weekend!
Jun 27 '08 #8

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

Similar topics

5
2122
by: Paul Scotchford | last post by:
Hi all, Thanks in advance to any contributions to my question. Im running SQLServer 2000 in a Win 2000 Server env. Background: ========== The database has many views that range from simple to complex joins on tables.
1
2694
by: lawrence | last post by:
This PHP function prints out a bunch of Javascript (as you can see). This is all part of the open source weblog software of PDS (www.publicdomainsoftware.org). We had this javascript stuff working, but it only worked for IE. You can see a working version here: http://www.publicpen.com/designer/mcControlPanel.php username: designer password: designer123 However, I've tried to rewrite this so it would work in all browsers,
1
2669
by: Dalan | last post by:
I'm developing a report selection form and one of the elements of design is providing Date from/to text boxes. I have a Table that contains all of the information regarding the reports and did create a column for assigning a value if dates are required for the reports (1=yes, -0=no). Need to know what code to use and where to allow this feature to be used on the report selection form and to have the Date from/to boxes appear only if in...
1
1543
by: Micak | last post by:
I'm using radnom selection in ms access to select certain number of questions for the exam. i have two versions of the report: - one without marked answers - one with marked answers the problem is when i generate the reports one after another, i don't get the same selection of questions. Does anyone knows how to generate two parallel reports that would give the same random selection?
2
13500
by: Mikey | last post by:
Sample VB .NET source code to create mailing labels or customized letters using MS Word MailMerge This VB .NET source code will start MS Word and call methods and set properties in MS Word to execute a MailMerge to create mailing labels or customized letters. A label name known to MS Word MailMerge mailing label wizard may be used or a template file containing the field names Line1 thru Line5 for each record to be printed. If a...
3
13098
by: jonfroehlich | last post by:
I am looking for a Visual Studio plugin or macro to manage comment headers in my .cs files (e.g., for copyright and/or open source license information). I realize that I could edit the template Class.cs file in %Program Files%\Microsoft Visual Studio 8\Common7\IDE \ItemTemplates\CSharp\1033\Class.zip; however, this would only work for classes I create from now on. I believe there are commercial programs out there that do this (e.g.,...
2
5070
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer must be embedded somewhere in the source code, and I would like to know if anyone knows where to find the correct answer. I would greatly appreciate it!! Thanks!! <!--put the preloads file here as it must load before the website class...
4
68171
by: emily224 | last post by:
Hello, I have been trying to understand this source code, which I retreived from my online course test. I would like to know how to find the answer for the question on the test. Im sure the answer must be embedded somewhere in the source code, and I would like to know if anyone knows where to find the correct answer. I would greatly appreciate it!! Thanks!!
1
3004
by: cwby1966 | last post by:
Hi I am trying to change the control source of a control on a report depending on a selection on the form where the report was called from. Here is the code i have tried: Private Sub Report_Open(Cancel As Integer) If (Forms!!fundfltr = "GO") Then Reports!!.Control Source = Reports!!.Caption = "GO" End If End Sub
30
4182
by: CD Tom | last post by:
I found Stephen Lebans modReportToPDF and have been trying to get it to work in my application. I've downloaded his database and when I run his test it works fine. I then added it to my application and it works up to the point where it creates the snp file.then the app doesn't continue. If anybody has the modReportToPDF where it stops is at the point where he has the 'Export the selected Report to SnapShot Format. Docmd.output to...
0
8003
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8498
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8478
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8152
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6817
agi2029
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5476
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2474
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1331
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.