Forum Discussion

PeterD's avatar
PeterD
Copper Contributor
Nov 21, 2022

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

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

  • Willjoe2442's avatar
    Willjoe2442
    Brass Contributor

    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

  • 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

    • PeterD's avatar
      PeterD
      Copper Contributor

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

Resources