Hard Coding Network Printer in a Module

J

j

Hello brilliant minds:

I have a DOS script running on a server, which opens an
Access database and runs a macro that is executing a
module. No user is logged in. How can I hard code a
network printer into my Access module? Your assistance
will be greatly appreciated!!! By the way, if you know of
a better solution, please feel free to suggest...

Thanks, J.
This example goes to a default Windows network printer:
@ECHO OFF
:START
START /w C:\PROGRA~1\MICROS~2\OFFICE11
\MSACCESS.EXE "C:\DOCUME~1
\jgray\Desktop\SQL_RE~2.MDB" /x "testexport"
EXIT
GO
Access Module:
Function OpenExportReports()
On Error GoTo Err_OpenExportReports_Print
DoCmd.OpenReport "report name", acViewPreview
DoCmd.PrintOut
DoCmd.Close acReport, "report name"
DoCmd.Quit
Exit_OpenExportReports:
Exit Function
Err_OpenExportReports_Print:
MsgBox Err.Description
Resume Exit_OpenExportReports
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top