Need printing help

Mgreencornerstone

Board Regular
Joined
Nov 23, 2005
Messages
116
I have a print button on a form to print it. THe problem is that it always prints to a certain printer. How can I adjust the code so that it prints to the default printer on machine access is running on.
 

Some videos you may like

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,432
Hi
Can you post that code that is linked to the form? Also, have you considered printing a report instead of a form?
Andrew
 

Mgreencornerstone

Board Regular
Joined
Nov 23, 2005
Messages
116
Private Sub NewPrintButton_Click()

On Error GoTo Err_NewPrintButton_Click


DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.PrintOut acSelection

Exit_NewPrintButton_Click:
Exit Sub

Err_NewPrintButton_Click:
MsgBox Err.Description
Resume Exit_NewPrintButton_Click

End Sub
 

Andrew Fergus

MrExcel MVP
Joined
Sep 9, 2004
Messages
5,432
Hi

I tried your code and cannot re-create the problem, nor can I see anything wrong with it. Instead of printing the form, have you considered printing a report? If so, does that print to the default printer correctly?

Andrew
 

Watch MrExcel Video

Forum statistics

Threads
1,111,599
Messages
5,541,166
Members
410,543
Latest member
ExcelGlenn
Top