Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Jan 2003
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Active Window--Switchboard vs. Open Report (Access 2000)

    I have created a custom dialog box that is opened by clicking on a Switchboard command button. The dialog box has options to open various reports (using a macro). However, when the selected report opens and the user clicks on the cancel button of the dialog box, the Switchboard becomes the Active Window and the report is minimized. We need the report to be the active window and the Switchboard behind it. The database has the Switchboard form maximized on Startup, and I want to keep the Switchboard open when the user closes the report, as many users are not familiar with Access. Any advice on code to make sure the report being opened becomes the Active Window when the user cancels or closes the custom dialog box? Many thanks....Mary

  2. #2
    2 Star Lounger
    Join Date
    Jan 2003
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Active Window--Switchboard vs. Open Report (Access 2000)

    Hello, Hans...Many thanks for the quick response. The custom dialog box has option buttons and a connected macro w/action "OpenReport." Where should I put the procedure you sent? Thanks...Mary

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

    Re: Active Window--Switchboard vs. Open Report (Access 2000)

    You should probably close the dialog before the report opens:

    Private Sub cmdOpenReport_Click()
    DoCmd.Close acForm, Me.Name, acSaveNo
    DoCmd.OpenReport "rptSomething", acViewPreview
    End Sub

    Alternatively, you can hide the switchboard temporarily when you open the dialog or report, and make it visible again when the user closes the dialog or report.

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

    Re: Active Window--Switchboard vs. Open Report (Access 2000)

    If you're using a macro, insert a line above the OpenReport action. Set the Action of this new instruction to Close, and in the lower part of the macro design window, set the Object Type to Form, the Object Name to the name of the dialog form, and the Save argument to No. You then have the equivalent of the VBA code I posted.

  5. #5
    2 Star Lounger
    Join Date
    Jan 2003
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Active Window--Switchboard vs. Open Report (Access 2000)

    Hans, you're brilliant! With your suggestion, the report now is active window until user closes it and then the Switchboard becomes the Active Window! It works beautifully; I don't know why I could not think to put the Close action before the OpenReport command; I was trying to put it afterwards and of course was having no luck! I appreciate your help so very much! Thanks...Mary

Posting Permissions

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