Print Dialog: Setup... Error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ChipR
    Recognized Expert Top Contributor
    • Jul 2008
    • 1289

    Print Dialog: Setup... Error

    Ok, I'm sure someone has seen this before, but I can't find a solution.

    When using DoCmd.RunComman d acCmdPrint, the Setup... button in the Print Dialog gives me a message box saying:
    -------------------------------------------------------------------------------------
    This action can't be carried out while processing a form or report event.
    A macro specified as the OnOpen, OnLoad, OnClose, OnFormat, OnRetreat, OnPage, or OnPrint property setting contains an invalid action for the property.
    When you click OK, an Action Failed dialog box will display the name of the macro that failed and its arguments.
    -------------------------------------------------------------------------------------
    When I do click OK, there is no other dialog box.

    One user on another forum said s/he solved the problem by setting the report to PopUp, but that didn't work for me either.

    Any ideas?
  • DonRayner
    Recognized Expert Contributor
    • Sep 2008
    • 489

    #2
    Originally posted by ChipR
    Ok, I'm sure someone has seen this before, but I can't find a solution.

    When using DoCmd.RunComman d acCmdPrint, the Setup... button in the Print Dialog gives me a message box saying:
    -------------------------------------------------------------------------------------
    This action can't be carried out while processing a form or report event.
    A macro specified as the OnOpen, OnLoad, OnClose, OnFormat, OnRetreat, OnPage, or OnPrint property setting contains an invalid action for the property.
    When you click OK, an Action Failed dialog box will display the name of the macro that failed and its arguments.
    -------------------------------------------------------------------------------------
    When I do click OK, there is no other dialog box.

    One user on another forum said s/he solved the problem by setting the report to PopUp, but that didn't work for me either.

    Any ideas?
    Try moving your (DoCmd.RunComma nd acCmdPrint) command to the on activate event for the report.

    Comment

    • ChipR
      Recognized Expert Top Contributor
      • Jul 2008
      • 1289

      #3
      How would I accomplish this if I want to print from a Print button on the report itself?

      Comment

      • DonRayner
        Recognized Expert Contributor
        • Sep 2008
        • 489

        #4
        I'm not sure about a button on a report but on a form it would be something like this.

        Code:
        DoCmd.OpenReport "ReportName", acViewPreview
        Dim rpt As Report
        Set rpt = Screen.ActiveReport
        With rpt
        Application.RunCommand acCmdPrint
        End With
        You will probally have to massage it a bit, but it should get you started.

        Comment

        • ChipR
          Recognized Expert Top Contributor
          • Jul 2008
          • 1289

          #5
          I'll give it a try. Thanks :)

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32633

            #6
            Where did you get to with this Chip?

            I would expect a problem trying to run a Print when the report is already in a print process essentially (opening has an option for PrintPreview mode). I would expect problems trying to print when open. This is just logical thinking though. I make no claim to any great experience in this area.

            Comment

            • ChipR
              Recognized Expert Top Contributor
              • Jul 2008
              • 1289

              #7
              Haven't worked with this yet, but I hope to. Right now I'm working on the detailed user's guide to my application, along with a couple other assignments. No fun :(

              Comment

              Working...