Solved

Access VBA print forms automatically

Posted on 2011-09-13
4
297 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)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Run Time Error 3075 15 47
Running sum query 6 35
Access Query based on a Form Field 2 22
Import Excel Worksheets into ms access with worksheet name 7 13
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
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…

863 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

18 Experts available now in Live!

Get 1:1 Help Now