Print Multiple reports command button (1 Viewer)

evanhughes

Registered User.
Local time
Today, 17:26
Joined
Nov 26, 2009
Messages
46
Hi All

I have a form to run a report via a query with criteria.

I have a combo box on the form to select the criteria to run the individual report.

What I need is another button to publish as pdf all the reports individualy from the list in the combo box.

Eg;
List in combo box
1
2
3
4
5

I can select one of these and reun the report but I need to Publish each report as pdf's
1
2
3
4
etc.

Any ideas.
 

HiTechCoach

Well-known member
Local time
Today, 11:26
Joined
Mar 6, 2006
Messages
4,357
Well that depend a lot on the version of Access you are using.

Would you mind sharing what version of Access you will be using for this project?
 

evanhughes

Registered User.
Local time
Today, 17:26
Joined
Nov 26, 2009
Messages
46
Dear Boyd

I am using access 2010 for creation of database but operators will be using access 2007 for reporting and data entry.

Evan
 

HiTechCoach

Well-known member
Local time
Today, 11:26
Joined
Mar 6, 2006
Messages
4,357
Thanks for the information.

Using Access 2007/2010 makes things a lot easier since there is built in support for PDF's staring with Office 2007.

See if this example helps: Batch Printing and Save As PDF

If it were mine, I would use a list box instead of a combo box, This will allow the user to select the desired report(s) to print. This will allow any combination of reports to be printed.
 

evanhughes

Registered User.
Local time
Today, 17:26
Joined
Nov 26, 2009
Messages
46
Hi Boyd

Have been fiddling with the code from your batch print db and no matter what i try i just can't get it to work completly. Firstly when running the form i can't gry out the last selection which makes a new record in table if accidently selected. Secondly when previewing selected records no matter what is selected it shows all reports not just the selected ones it also shows all reports when nothing selected. Thirdly when you do review reports they are not in correct order all the pages from all reports are jumbled. And lastly get code error when trying to print to pdf's.

Have attached my db with the hope that if you get a chance you could take a look.

Tired of strssing or printing reports individualy.

Thanking you for all your help so far and anything you van help in the future.

Kindest Regards

Evan
 

Attachments

  • Database1.accdb
    1 MB · Views: 332

HiTechCoach

Well-known member
Local time
Today, 11:26
Joined
Mar 6, 2006
Messages
4,357
Evan,

I have downloaded your database. I will take a look and let you know what I find.
 

HiTechCoach

Well-known member
Local time
Today, 11:26
Joined
Mar 6, 2006
Messages
4,357
I had to update the query for the report to include the other table with the select to print field

I also changed the report to have the Unit Section Header force a new page

I see lots of issues with the table design.

1) Every table need a primary key.

I would recommend that you use a auto number. My example was using a a numeric primary key. I have to change the code to wrap the unit code with quotes

2) you have lots of repeating fields that really need to be in a child/related one-to-many table.


I have attached a copy that is working. I did not fix any of the table design issues.
 

Attachments

  • Database1_HiTechCoach.accdb
    1.1 MB · Views: 435

evanhughes

Registered User.
Local time
Today, 17:26
Joined
Nov 26, 2009
Messages
46
Thanks Boyd
It works fine. I understand about your comments and before the database goes live I will attend to them.
Maybe you could help me with my latest problem with a query.
I need this iif statement to only apply when the query date is greater than 31/01/2011.

Evan
 

evanhughes

Registered User.
Local time
Today, 17:26
Joined
Nov 26, 2009
Messages
46
Dear Boyd

What I have is an if statement that applies a charge to certain unit codes.
I need it to apply only to these unit codes when the finish date field is later than 31/01/2011 all finish dates prior will return a value of zero.

My Current Code applies value to all records in table.

Charge: iif([unitcode]="il001",Format("5.00",Currency),Format("0.00",Currency))

Evan
 

HiTechCoach

Well-known member
Local time
Today, 11:26
Joined
Mar 6, 2006
Messages
4,357
Dear Boyd

What I have is an if statement that applies a charge to certain unit codes.
I need it to apply only to these unit codes when the finish date field is later than 31/01/2011 all finish dates prior will return a value of zero.

My Current Code applies value to all records in table.

Charge: iif([unitcode]="il001",Format("5.00",Currency),Format("0.00",Currency))

Evan

Evan,

Assuming you have a field named: [FinishDate]

Is this what you want:

Charge: iif([unitcode]="il001" and [FinishDate] > #1/31/2011# , Format(5,Currency),Format(0,Currency))


I normally do not do any formatting in a query. The use of Format converts numbers to strings. Formatting to currency will mean that you will not be able to perform any calculations of the value.

I would use:
Charge: iif([unitcode]="il001" and [FinishDate] > #1/31/2011# , 5, 0)

I find it best to do the formatting in the text box control on a form or report.
 

evanhughes

Registered User.
Local time
Today, 17:26
Joined
Nov 26, 2009
Messages
46
Hi Boyd

I hope this finds you well.

I sorted out the batch print routine and it works fine if only one selection is made on the form but if multiple selections are made it won't print the reports individually but tries to combine them all together as if running one report without separating by the unit code.

I don't know if I did something wrong but any suggestions would be grateful.

Evan
 

HiTechCoach

Well-known member
Local time
Today, 11:26
Joined
Mar 6, 2006
Messages
4,357
Evan,

Would it be possible to post another copy of your database so I can see what you have done so far?
 

evanhughes

Registered User.
Local time
Today, 17:26
Joined
Nov 26, 2009
Messages
46
Dear Boyd

Here is the database.

And thankyou for the assistance.

Evan
 

Attachments

  • RENTAL.accdb
    1.1 MB · Views: 111

evanhughes

Registered User.
Local time
Today, 17:26
Joined
Nov 26, 2009
Messages
46
Hi Boyd

Here is the database.

And thankyou for the assistance.

Evan
 

Attachments

  • RENTAL.accdb
    1.1 MB · Views: 102

HiTechCoach

Well-known member
Local time
Today, 11:26
Joined
Mar 6, 2006
Messages
4,357
I got your new attachment

I will take a look and get back to you.
 

HiTechCoach

Well-known member
Local time
Today, 11:26
Joined
Mar 6, 2006
Messages
4,357
I added a grouping by Unit to the report.

I also changed the other grouping form Start to a calculated field on start as YYYY/MM.

See if the attached works better for you.
 

Attachments

  • RENTAL_HiTechCoach.accdb
    1.1 MB · Views: 138

evanhughes

Registered User.
Local time
Today, 17:26
Joined
Nov 26, 2009
Messages
46
Thanks Boyd

The only issue is it does not total each unit code report but totals only all reports togrther on last report.

Evan
 

Users who are viewing this thread

Top Bottom