Click to See Complete Forum and Search --> : printer


Nath
December 3rd, 1999, 03:38 PM
on a button i need to be able to choose witch printer i need to print on. i have no idea the way to do it.
thank you in advanced

valkyrie
December 7th, 1999, 09:16 PM
First, include the visual basic common dialog controls in your application (by pressing Ctrl-T). Place the common dialog control in your form. Now, include this code in your button's Command1_click() command.


Sub Command1_Click()
Commondialog1.ShowPrinter 'This brings up the print dialog box
'which will give you a selection of printers
'in your system.
End Sub



Hope that this helps...

Cheers...

Nath
December 8th, 1999, 09:02 AM
thanks a lot

nath

smalig
December 10th, 1999, 08:10 AM
Also you can select a printer programatically from your VB application. Check follow sample:

http://vbcode.webhostme.com/en/click.asp?id=80


smalig@hotmail.com
http://vbcode.webhostme.com/

Nath
December 10th, 1999, 10:15 AM
thank you for you're help

but it doesn't work on a click button but i'm keeping the code for futur use and the adress

nath

Nath
December 23rd, 1999, 08:07 AM
I wanted to thank you for the help andi found the code that worked for me so here it is if you ever need it




Private Sub ImageImprimante_Click()
On Error GoTo Err_ImageImprimante_Click

DoCmd.DoMenuItem acFormBar, acrecordmenu, acSaveRecord, , acMenuVer70
Dim stDocName As String, Critere As Variant

Critere = Me![No_Appel]
stDocName = "E_NoAppel"
DoCmd.OpenReport stDocName, acViewPreview, [No_Appel], "[No_Appel] = " & Critere

'This is the line that opens the file menu printer
' to be able to choose the printer

DoCmd.DoMenuItem acFormBar, acFile, 6

Exit_ImageImprimante_Click:
Exit Sub

Err_ImageImprimante_Click:
MsgBox Err.Description
Resume Exit_ImageImprimante_Click

End Sub

And Happy holydays
nath :)