473,398 Members | 2,427 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Printing multiple forms in Access 2007

Greetings:

I have a small Acces 2007 database that has 3 forms I need to print containing data from a recordset based on a query.

I can pull up all three forms from one button to preview the forms:

Private Sub cmdPreviewSelectChem_Click()
On Error GoTo Err_cmdPreviewSelectChem_Click

Dim stDocName As String
Dim stDocNameB As String
Dim stLinkCriteria As String

stDocName = "prntAirMonActLevels"
stDocNameB = "prntChemExpoInfo"
stDocNameC = "prntChemProperties"
DoCmd.OpenForm stDocName, acPreview
DoCmd.OpenForm stDocNameB, acPreview
DoCmd.OpenForm stDocNameC, acPreview

Exit_cmdPreviewSelectChem_Click:
Exit Sub

Err_cmdPreviewSelectChem_Click:
MsgBox Err.Description
Resume Exit_cmdPreviewSelectChem_Click

End Sub

However, I would like to be able to call a print dialog box to print the forms to pdf. Currently I am using the windows print dialog box because I need to output to pdf (unless there is a way to print directly to pdf in Access). Calling the dialog box only prints one at a time and I need to make sure all three forms print.

Here is the code from the current print button (with a name of one of the print forms in it):

Private Sub Command5_Click()
On Error GoTo Err_Command5_Click

Dim stDocName As String
Dim MyForm As Form

stDocName = "prntAirMonActLevels"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.RunCommand acCmdPrint
DoCmd.SelectObject acForm, MyForm.Name, False

Exit_Command5_Click:
Exit Sub

Err_Command5_Click:
MsgBox Err.Description
Resume Exit_Command5_Click

End Sub


Thanks in Advance,

Catherine
Feb 28 '08 #1
3 4452
jeffstl
432 Expert 256MB
I am honestly not sure if there is a way to print all 3 forms with one dialog command. The xperts of this forum might know.

However, I would personally recommend that rather then print your forms out you simply create a report in access that contains the data you want from all 3 forms into one convenient report. This will also make printing data from all 3 forms much easier to accomplish obviously.

Just a thought though, I am not sure what exactly your end goal is.
Feb 28 '08 #2
The forms create separate pages which are different attachments to a document, so the issue of data rolling to multiple pages when printing can create a problem. I may just have to put three print buttons on the form. I have figured out how to print to pdf directly...

If I can print to the pdfwriter, the need for the dialog box goes away...except for the file "save as" dialog.

Thanks!

Catherine
Feb 28 '08 #3
jeffstl
432 Expert 256MB
OK. I did not realize you were preparing attachement files for an email with this.

Makes sense. Sorry I couldnt help more!
Feb 28 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Jody Gelowitz | last post by:
I am trying to find the definition of "Safe Printing" and cannot find out exactly what this entitles. The reason is that I am trying to print contents from a single textbox to no avail using the...
8
by: Rick Lederman | last post by:
I am using a PrintDocument and PrintDialog to print. The first time that I print it works, but when I try to print a second time without exiting the entire program I get an...
1
by: Allen Browne | last post by:
In Access 2007, you can select multiple items in the Navigation Pane, via Shift+Click, Ctrl+Click, Shift+arrow keys, etc. You can also Shift+Del an object to delete it without confirmation (just...
37
by: Allen Browne | last post by:
If you develop for others, you probably have multiple versions of Access installed so you can edit and create MDEs for clients in different versions. This works fine under Windows XP, even with...
6
by: Bob Alston | last post by:
Looking for someone with experience building apps with multiple instances of forms open. I am building an app for a nonprofit organizations case workers. They provide services to the elderly. ...
1
by: tmh86 | last post by:
I am currently building a database within Access 2007. I have a form that is populated via vba coding and thereform is not stored in a specific table. I have created a button that essentially runs...
5
by: jbbooey | last post by:
While printing reports in Access 2007, how can I print a section in a report over and over (looping) multiple times using VBA or a macro?
18
by: Brett | last post by:
I have an ASP.NET page that displays work orders in a GridView. In that GridView is a checkbox column. When the user clicks a "Print" button, I create a report, using the .NET Framework printing...
1
by: pusparaj | last post by:
I had developed an application using MS Access 2003 and in my reports I have no problem whether viewing or printing it in one page from my PC or Notebook. Also no problem when I opened this...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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...

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.