[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 308
  • Last Modified:

Access VBA print forms automatically

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
Murray Brown
Asked:
Murray Brown
  • 2
1 Solution
 
Dale FyeCommented:
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
 
Jeffrey CoachmanCommented:
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
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
thanks very much
0
 
Jeffrey CoachmanCommented:
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now