Access Printing/Batch Plot Help Please (1 Viewer)

gunslingor

Registered User.
Local time
Today, 09:40
Joined
Jan 13, 2009
Messages
50
:cool:Okay,

I have a form with a subform. The main form will have things like "Print Selection" Button, "Printer" combo box, "Copies" text box, and similar things one might expect in a print dialog box. The subform is datasheet view only and pulls it's information from a table that lists information for associated visio drawings stored in the a project subfolder.

Here's what the user will need to be able to do:
1. the user will select items in the subform using the control or shift key to select multiple items.
2. the user will select the print settings
3. the user will hit the "print selection" button
4. all visio drawings will be printed.

Help:
1. How do I get an object or objects in vba that represents the records selected in the subform?
2. How do I set the combobox row source to list all printers available on the working machine. Note that this project will be on many PCs, all with different printers.
3. Any other access batch plotting tips or references to examples.

Thanks,

:cool::cool::cool::cool:
 

DCrake

Remembered
Local time
Today, 17:40
Joined
Jun 8, 2005
Messages
8,632
Here is a small demo on printer selection that ay be usefull to you.
 

Attachments

  • ChangePrinter.zip
    20.4 KB · Views: 97

gunslingor

Registered User.
Local time
Today, 09:40
Joined
Jan 13, 2009
Messages
50
Here is a small demo on printer selection that ay be usefull to you.

Thanks, but I can't seem to view anything in design view. I have almost completed this part of the project.

In case anyone needs assistance over the next, say, 10 years:
(windows XP, access 2003, VBA, Printing, Batch plotting)

1. Add something like this to the form_open event to populate the printer list
Code:
Private Sub Form_Open(Cancel As Integer)
Dim strDefaultPrinter As String ' Variable to hold the default printer index.
Dim prt As Printer ' Variable to hold the printer object.
Dim accObj As AccessObject ' Variable to hold the report object while cycling through the AllReports collection.
' Fill the printer list.Make sure the RowSource is empty.
Me!cmbPrinter.RowSource = ""
' Cycle through the printers installed on the machine and add them to the combo box.
For Each prt In Application.Printers
' Use the new AddItem method to add the printer name to the combo box.
    Me!cmbPrinter.AddItem prt.DeviceName
Next
' Remember the default printer.
strDefaultPrinter = Application.Printer.DeviceName
' Set the combo box to the default printer.
Me!cmbPrinter = strDefaultPrinter
Me!cmbPaperSize = 1
End Sub

2. To get paper sizes available for the printer selected call this function:
Call GetPaperList(Me!cmbPrinter.Text, paper_list)
from a module called modPrinters that can be found here(Note that I have modifed this function to accept two arguements, the name of the printer, and a reutrn arguement. The code you can download gives info for the default printer only. Modification is fairly easy.):
download:ODC_Acc10_Printers.exe.
From: http://msdn.microsoft.com/en-us/library/aa139946(office.10).aspx
And please let us know if this was useful for you!
Tata!:p:eek:
 

Users who are viewing this thread

Top Bottom