Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Nov 2002
    Location
    London, Gtr London, England
    Posts
    496
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Dear Loungers,

    I have this situation:
    • Form1 open as a popup - and so Activate has occurred
    • activity on Form1 causes Form2 to open as a popup & modal
    • action taken on Form2 then it is closed


    The visual result is that Form1 is presented to the user, it was always underneath Form2. Can I guarantee that it is activated - I think focus doesn't apply here since there are enable controls on the form?

    The reason for the question: what I want to do is run some code once Form2 has closed, OnClose doesn't work (although it should, this is something to do with the way commands are actioned by Access and/or the OS) so I think my solution is to have a conditional OnActivate event on Form1.

    thank you.......................... liz

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    One option, which bypasses the problem in a way , is this.

    The code (presumably attached to some event associated with form1 ) that opens form2 does so using the acDialog option in the Docmd.OpenForm command.
    Code execution for that procedures pauses at that point and resumes when the form is closed, so you don't need to know what event to use.

    e.g. This code will open frmSomeForm, then requery the current form when frmSomeForm is closed.
    Code:
    DoCmd.openform "frmSomeForm", , , , , acDialog
    me.requery
    Regards
    John



  3. #3
    4 Star Lounger
    Join Date
    Nov 2002
    Location
    London, Gtr London, England
    Posts
    496
    Thanks
    8
    Thanked 0 Times in 0 Posts
    oh yes... only just getting to using vba as default rather than macros so still a bit hazy.

    many thanks............................liz

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    You can do the same thing with a macro. (This is the 2010 Macro builder screen)

    [attachment=90348:ACDialog.gif]
    Attached Images Attached Images
    Regards
    John



Posting Permissions

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