Printing a form in Access is not working with switch /runtime

Copper Contributor

Windows 11 / Access 2021 (Version 2210 Build 16.0.15726)

 

Printing a form is well working:

DoCmd.SelectObject acForm, Form_MyForm.Name, True

then:

RunCommand acCmdPrint ' working well with printer dialog

or:

DoCmd.PrintOut  ' working well without printer dialog

 

But when i start my access (accde)  with option "/runtime" both versions of printing the form are not working: Error "Der Befehl oder die Aktion 'Drucken' ist zur Zeit nicht zur Verfügung".

standard printer is installed. 

What can be the reason?

Thanks Peter

4 Replies

Hi,

 

Your code selects the form in the navigation pane which is not available in the Runtime (mode).

 

The best solution would be to not print a form but a report which exists for that purpose. If you select the form and File - Save As in the ribbon you can choose to save it as report.

 

Servus
Karl
************
Access News
Access DevCon

Thank you, Karl, yes this solution with a report ist working now. But my intention was to avoid extra reports for this purpose.  

The right tool for the job, though.

Click File > Print, and then click Print Preview. If the report is open, right-click the document tab for the report, and then click Print Preview.

 

Regards,

Will