Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Jun 2002
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MDB to MDE Error (Access 97 sr2 - NT4 6a)

    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.

  3. #3
    2 Star Lounger
    Join Date
    Jun 2002
    Posts
    117
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: MDB to MDE Error (Access 97 sr2 - NT4 6a)

    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

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: MDB to MDE Error (Access 97 sr2 - NT4 6a)

    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)?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •