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

    on Close event (Access 2000)

    OnClose event in Reports

    In the OnClose event of the report i have the command to open the form:
    DoCmd.OpenForm "frmMain", acNormal, "", "", , acNormal
    DoCmd.Maximize



    However, when i give the command from a control on a form, like that:

    DoCmd.Close acForm, Me.Name
    DoCmd.OpenReport stDocName, acPreview, , stLinkCriteria


    I cannot see the preview of the report, and only the form frmMain.Yet, when i close the form manually, then the report preview appears.
    Obviously it is open but i cannot see it because of the form.Why my command to close the form does not work?
    How can i see the preview report, and at the same time preserve the OnClose event of the report?I think my error lies with the form and not with the report?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: on Close event (Access 2000)

    You either have to close the form, which is probably modal, or hide it, so add either of the following lines to the code in your form routine:

    DoCmd.Close acForm, Me.Name

    OR

    Me.Visible = False
    Charlotte

Posting Permissions

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