hostmake.blogg.se

Access runtime 2010 vba application printer error
Access runtime 2010 vba application printer error





access runtime 2010 vba application printer error
  1. #Access runtime 2010 vba application printer error how to#
  2. #Access runtime 2010 vba application printer error full version#
  3. #Access runtime 2010 vba application printer error software#
  4. #Access runtime 2010 vba application printer error code#
access runtime 2010 vba application printer error

The utility has a function named OpenTheReport() to use instead of DoCmd.OpenReport.

#Access runtime 2010 vba application printer error code#

You can also view the code from this utility.

#Access runtime 2010 vba application printer error how to#

The utility also illustrates how to manipulate the Printer object and the Printers collection introduced in Access 2002.Ĭlick to download the utility (30KB, Access 2002/3 mdb format, zipped). The utility works with MDE files and runtime versions also. Whenever they open the report, it is sent to that printer. This utility lets the end user assign one of their printers to each report. You can design a report to use one of your printers by choosing Page Setup from the Page Setup ribbon (Access 2010), the Report Tools ribbon (Access 2007), or the File menu (previous versions.) But that approach is useless if others use your report: you do not know what printers they will have installed. Run-time error '2191': You can't set the Printer property after printing has started.Īnyway, another utily which works in Runtime, you can find in here, by Allen Browne:ĭaniel van den Berg | Washington, USA | "Anticipate the difficult by managing the easy"ĭoCmd.Microsoft Access: Applications and Utilities If you try to do so, the following run-time error is displayed: You also cannot set form or report printer properties after printing has started. To change a report's printer settings, you should use code running in a separate form or module that opens the report in Print Preview or Design View before changing printer settings and printing the report. For this reason, attempting to change a report's printer settings from all other report events, such as the Open event, will return a run-timeĮrror. To redo the layout for a report if those settings are changed from the events that are fired when you open a report. Access doesn't currently have the ability Important While Access will allow you to change a report's printer settings when a report is opened from event procedure code running in the report's Activate event, you should not do so. See the notice in the MSDN article mentioned above: Hmm strange indeed, which Event are you placing the code? 'change the printer to be Invoice PrinterĭoCmd.OpenReport "report_name", acViewNormal

access runtime 2010 vba application printer error

'Inside the function where the report opens= Public Declare Function SetDefaultPrinter Lib "winspool.drv" _Īlias "SetDefaultPrinterA" (ByVal pszPrinter As String) As Long Here's the code for the benefits of others as well Hopefully this will be the permanent fix. I found different code in changing the printer without using "application.printers" so far no problem yet. I also tried opening the report in "Hidden" view and then change the report printer and then open the report again in a "Normal" view.Īnyway, I got it to work. I placed the function before opening the report. Need suggestions on how to fix this intermittent error. When I hit OK button, application will be close.

#Access runtime 2010 vba application printer error software#

"The exception unknown software exception (0xc0000417) occured in the application at location 0x785520f0" Here's the error I got, or sometimes no error message at all: If Not blnPrinterSet Then MsgBox "Invoice Printer NOT found.", vbCriticalĪccess 2010 crashed everytime it sees " application.printers" StrDefaultPrinter = Ĭall SetSpecificPrinter(strDefaultPrinter) StrDefaultPrt = Set Application.Printer = Application.Printers(strPrinterName)ĭoCmd.OpenReport "reportName", acViewNormal Set Application.Printer = Application.Printers(strDefaultPrt ) Set rpt = Reports("reportName") Set rpt.Printer = Application.Printers(strPrinterName)ĭoCmd.OpenReport "reportName", acViewNormal VERSION 1:=ĭoCmd.OpenReport "reportName", acViewPreview,, ,acHidden I tried different codes from different forums on how to change the printer but it intermittenly crashed in "application.printers"

access runtime 2010 vba application printer error

#Access runtime 2010 vba application printer error full version#

I have NO problem in changing the Printer in 2003 ADP (connected to SQL 2005) working in Access 2010 Full Version but when I run the ADP/ADE file into another Server (Windows Server 2003 SP2) withĪccess Runtime 2010 I got intermittent error and the application shutdown.







Access runtime 2010 vba application printer error