Solved

Access VBA print forms automatically

Posted on 2011-09-13
4
296 Views
Last Modified: 2012-06-27
Hi

I have Access forms that are used to generate timesheets for mine drillers.
I show a rough version in the image below.
There are 36 of them in this case.
How do I print off all 36 automatically?

 One of 36 Timesheets
0
Comment
Question by:murbro
  • 2
4 Comments
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 36531825
I would recommend that you create a report that looks like your form.

Cannot remember how to do this in 2003, but in 2007, I've modified the Access Quick access Toolbar to include a Save As option.  If you open the form in design view, then do a Save As, you should be able to change the object type to a report.  (do this for both the main and subforms).

Then open the new report in design view, and change the SourceObject for your details to the subreport you created.

From there, you would go back to your original form, and add a button that opens the report.  I generally open the report in Preview mode, and then use the report shortcut menu to print it when I'm ready.
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 36532261
If you print out the form directly, it should print out all 36 records
or use code like this on a button on the form:
DoCmd.PrintOut acPrintAll


However if there are more records on the subform that can fit on the printout, it will only print what is visible on the screen.


This is why I am with fyed, in that you should develop a report that displays the same information, then print that.

In a report it is *much* easier to control the output with options like:
Page breaks
Can/Grow shrink
Grouping
Summaries
Sorting
...etc


JeffCoachman
0
 

Author Closing Comment

by:murbro
ID: 36532536
thanks very much
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 36532585
For the record, can you state the ultimate solution here?

If you decided to use a report, then fyed also deserves some credit here as well, especially for suggesting this first.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Suggested Solutions

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now