Results 1 to 4 of 4
  1. #1
    Travb81 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Aug 2014
    Posts
    18

    Second form opened from Form_Load event - relaunches in non-responsive format when closing database

    Hello,



    I have a line of code in the Form_Load event of my main menu form....
    Code:
    DoCmd.OpenForm "frmNotes", acNormal, , , , acDialog
    The code on the second form, to close itself is simply:
    Code:
    DoCmd.Close acForm, Me.Name
    For some reason, when I close my database, the frmNotes is opened again, but in a non-responsive state. I can't use any controls to close it.
    It occurs after all other forms have been closed, and i have to terminate the task.

    I note that since frmNotes is opened from the Form_Load event of frmMenu, it is displayed before frmMenu is displayed.

    If i change my first line of code above, to open the form without being modal/dialog mode, the frmNotes is still being launched on the Quitting of the application - but as it's no longer modal, it doesnt display. I know it's being loaded as i've got a beep event in a frmNotes routine.


    Why is this form loading by itself on application closing?

    Thanks

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Have you checked that your OnLoad code hasn't been copied to some other event like the UnLoad event or the OnClose event.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    Travb81 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Aug 2014
    Posts
    18
    Quote Originally Posted by Bob Fitz View Post
    Have you checked that your OnLoad code hasn't been copied to some other event like the UnLoad event or the OnClose event.
    Hi Bob,
    Yep. I searched for my OpenForm statement, and doesn't appear anywhere it shouldnt.
    Also commenting out the line, the database functions normally without this behaviour.

    It's something to do with the frmMenu, and that being set as the default display form.
    If i move my OpenForm statement to the load even of another form, i dont have this glitch....
    It's repeatable - happy to knock up a simple demo file if you'd like?
    Cheers

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Yes. Can you post a copy of the db
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 10-03-2018, 06:04 AM
  2. Replies: 2
    Last Post: 04-20-2017, 02:51 PM
  3. Code for closing all opened forms
    By gstylianou in forum Access
    Replies: 9
    Last Post: 06-30-2014, 01:35 AM
  4. Replies: 2
    Last Post: 02-29-2012, 01:09 PM
  5. Form_Load Event
    By Juan4412 in forum Programming
    Replies: 4
    Last Post: 07-12-2011, 04:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums