• MDB to MDE Error (Access 97 sr2 – NT4 6a)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » MDB to MDE Error (Access 97 sr2 – NT4 6a)

    Author
    Topic
    #394702

    Created an MDB and tested the front on 5 different PCs. All users can run the reports successfully. Converted the MDB on the design PC to an MDE and when tested on the other 4 PCs, 2 worked correctly and 2 generated the following error message:

    “The OpenForm action was canceled. You used a method of the DoCmd Object to carry out an action in Visual Basic. But then clicked cancel in a dialog box

    Viewing 1 reply thread
    Author
    Replies
    • #725599

      When does this error occur? When the mde database is opened, or later? Can you find out which DoCmd.OpenForm instruction causes this error? You can search the VBA code in the mdb version for all occurrences of DoCmd.OpenForm.

      • #726813

        Hi Hans,

        Thanks for responding.

        As your post indicated I did some digging and this is what I found so far. The MDE opens with a Main form and in the Open Event there is a DoCmd.Maximize. To run the report another form is opened from a button on the Main form. This form also contains in the Open Event, DoCmd.Maximize. Both forms work perfectly.

        The error is generated when the processing Notification form is opened. The Notification from also has the DoCmd.Maximize in the Open Event. I removed the DoCmd.Maximize from the Open Event of the form and the error went away. I am in the process of tracking down the next error.

        The Notification form contains three labels that notify the user which stage the report is in before it is printed. They become visible for each stage.

        Any ideas why the DoCmd.Maximize in the Open Event causes an error on the Notification form and not the other two?

        Thanks

        • #726835

          This kind of error message can be misleading – the real cause can be something else than the DoCmd.Maximize, it just triggers the error.

          The only suggestion I have at this moment is that you add error handling to all procedures and functions in the code, then generate the .mde anew. The “skeleton” for error handling in a procedurelooks like this; it’s similar for functions.

          Sub MyProcedure(…)
          On Error GoTo ErrHandler

          ‘ Code goes here

          ExitHandler:
          ‘ Do your cleaning up (setting objects to nothing etc.) here
          Exit Sub

          ErrHandler:
          MsgBox Err.Description, vbExclamation
          Resume ExitHandler
          End Sub

          Oh, just one more thing: do you have any ActiveX controls on a form or report in the database (i.e. controls that are not native to Access)?

        • #726836

          This kind of error message can be misleading – the real cause can be something else than the DoCmd.Maximize, it just triggers the error.

          The only suggestion I have at this moment is that you add error handling to all procedures and functions in the code, then generate the .mde anew. The “skeleton” for error handling in a procedurelooks like this; it’s similar for functions.

          Sub MyProcedure(…)
          On Error GoTo ErrHandler

          ‘ Code goes here

          ExitHandler:
          ‘ Do your cleaning up (setting objects to nothing etc.) here
          Exit Sub

          ErrHandler:
          MsgBox Err.Description, vbExclamation
          Resume ExitHandler
          End Sub

          Oh, just one more thing: do you have any ActiveX controls on a form or report in the database (i.e. controls that are not native to Access)?

      • #726814

        Hi Hans,

        Thanks for responding.

        As your post indicated I did some digging and this is what I found so far. The MDE opens with a Main form and in the Open Event there is a DoCmd.Maximize. To run the report another form is opened from a button on the Main form. This form also contains in the Open Event, DoCmd.Maximize. Both forms work perfectly.

        The error is generated when the processing Notification form is opened. The Notification from also has the DoCmd.Maximize in the Open Event. I removed the DoCmd.Maximize from the Open Event of the form and the error went away. I am in the process of tracking down the next error.

        The Notification form contains three labels that notify the user which stage the report is in before it is printed. They become visible for each stage.

        Any ideas why the DoCmd.Maximize in the Open Event causes an error on the Notification form and not the other two?

        Thanks

    • #725600

      When does this error occur? When the mde database is opened, or later? Can you find out which DoCmd.OpenForm instruction causes this error? You can search the VBA code in the mdb version for all occurrences of DoCmd.OpenForm.

    Viewing 1 reply thread
    Reply To: MDB to MDE Error (Access 97 sr2 – NT4 6a)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: