Results 1 to 12 of 12
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,877
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help Closing Down System? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    I

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

    Re: Help Closing Down System? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    You will have to set fOKToClose to True in all open forms where you have such a variable, just above the line where you quit. Perhaps others know of a clever way to do this, at the moment I can only think of enumerating them explicitly at the moment:

    If CurrentProject.AllForms("frmThis").IsLoaded Then
    Form_frmThis.fOKToClose = True
    End If

    If CurrentProject.AllForms("frmThat").IsLoaded Then
    Form_frmThat.fOKToClose = True
    End If

    etc.

  3. #3
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,877
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help Closing Down System? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    fOKToClose is defined as follows in frm_DLicense

    Dim fOKToClose As Boolean

    What is the correct syntax to reference the variable fOKToClose in frm_DLicense?

    If CurrentProject.AllForms("frm_DLicense ").IsLoaded Then
    Form_ frm_DLicense.fOKToClose = True
    End If

    Thanks, John

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

    Re: Help Closing Down System? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Yes, that should do it. Have you tried it?

  5. #5
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,877
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help Closing Down System? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Compile error: Method or data member not found on the following:

    Form_frm_DLicense .fOKToClose = True

    .fOKToClose = is highlighted

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

    Re: Help Closing Down System? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Make the variable public:

    Public fOKToClose As Boolean

  7. #7
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,877
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help Closing Down System? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    That compiles clean, however still hangs on the

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

    Re: Help Closing Down System? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Can you post a stripped down copy of your database?

  9. #9
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,877
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help Closing Down System? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Here you go with Rogers Access Library db modified to simulate my situation

    Open db and select Open Form and wait 2 minutes

    I'm trying to eliminate the Close Form message

    Thanks, John

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

    Re: Help Closing Down System? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    I single stepped through the code. The fOKToClose variable does get set to True, but the moment you call Application.Quit, it is reset to its default value False before the Form_Unload event occurs. The following works for me:

    If CurrentProject.AllForms("frm_Close_Test").IsLoaded Then
    'MsgBox "About to close form"
    Form_frm_Close_Test.fOKToClose = True
    DoCmd.Close acForm, "frm_Close_Test", acSaveNo
    End If

    This closes the form before Application.Quit can reset fOKToClose.

  11. #11
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Niagara Falls, New York, USA
    Posts
    1,877
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Help Closing Down System? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    Perfect, now the system shuts down like poop through a goose no matter inconsiderate my users are.

    I'm a little puzzeled how the reference to open forms works

    Form_frm_Close_Test.fOKToClose = True

    When I'm in a report I reference a form objects as:

    If IsNull(Forms![frm_TOC_BP_ACD]!memNote) Then
    NotesOnFile.Visible = False
    End If

    Would Forms![frm_Close_Test].fOKToClose = True work?

    Thanks, John

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

    Re: Help Closing Down System? (a2k (9.0.6926) SP-3 Jet 4.0 SP-8)

    No, that wouldn't work. Charlotte can probably explain what is behind this; I think the notation Form_frm_Close_Test refers to the class module of the form.

Posting Permissions

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