Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2012
    Posts
    8

    Unanswered: Close a form & return to main switchboard

    I open a form via Switchboard. After use, I click the Close (X) button and would like to close the form and return to Switchboard. I tried to put below code in On Close event but failed. The Switchboard appears for a short period of time and then both the form and the Switchboard are close all together. Can someone advise me how to accomplish this task.

    DoCmd.OpenForm “Switchboard”

  2. #2
    Join Date
    Jan 2009
    Location
    Kerala, India
    Posts
    183
    Check the Switchboard Form's Pop Up Property is set to YES or not. If it is set to YES then change it to NO. Check the status of the other Form also and change it No then retry.
    Last edited by apr pillai; 08-28-14 at 13:58.
    www.MsAccessTips.com (Learn MS-Access Tips & Tricks)
    Learn Advanced MS-Access Programming with sample VBA Code.

    All responses are based on Access 2003/2007

  3. #3
    Join Date
    Aug 2012
    Posts
    8
    Thanks for your advice. However, it does not work out the issue. Once the form is opened to max, the title bar disappears. The only way to resolve so far is to add a command button of restore on header section.

  4. #4
    Join Date
    Aug 2008
    Posts
    15
    You could add a button which saves your form closes it and returns to switchboard. In the onclick event. I have never seen any way to code the close button but this might be a good compromise. Good luck!

    DoCmd.RunCommand acCmdSaveRecord
    DoCmd.OpenForm "Main Switch"
    DoCmd.Close acForm, "frmName"
    Newbie trying to find his way through Access...

  5. #5
    Join Date
    Aug 2012
    Posts
    8
    Thanks for your code. May I ask why we need to save the record first since the data entered will be stored once I move from the field to next.

  6. #6
    Join Date
    Aug 2008
    Posts
    15
    I suppose it is not necessary depending on how your form works, I usually save in case there is some required field unfilled or whatever. Not an expert so Im sure I include a lot of redundant code in my database... just trying to provide a workaround until someone better comes along =)

    Good luck!
    Newbie trying to find his way through Access...

  7. #7
    Join Date
    Aug 2012
    Posts
    8
    Thanks for your reply.

Posting Permissions

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