Results 1 to 8 of 8
  1. #1
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Form Events (Access 2003 (2000 format))

    I have a form with a continuous subform. I also have a small popup form that display extra details about the current record in the subform.

    Because I can edit information in either the continuous form, or the popup, I can receive messages about the record being changed by another user.

    So whenever I move between the subform and the popup I need to first save the record.

    But I can't find any events that happen that I can use to save the record.

    I have tried using the Deactivate and LostFocus events for the Main form, the Deactivate and Lost focus for the subform and the Activate and GotFocus for the popup. Also the Exit Event of the subform control. None of them occur.

    What event occurs when I move from the subform to the popup?
    Regards
    John



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

    Re: Form Events (Access 2003 (2000 format))

    I don't think you need to use events such as LostFocus here.
    You can save the record in the subform (if it is "dirty") before opening the popup form.
    If you open the popup form as a dialog form (=popup and modal), the user cannot switch back to the subform without closing the popup form.

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Form Events (Access 2003 (2000 format))

    Thanks Hans

    Once I open the popup form, I want to keep it open, and as I move between records in the subform, I use the oncurrent event to requery the popup, to show full details of the current record.

    Users might also create a new record in the subform, then perhaps enter some optional fields using the popup.

    The popup is not modal.
    Regards
    John



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

    Re: Form Events (Access 2003 (2000 format))

    You may be able to use the On Enter / On Exit or On Focus / On Lost Focus events of each relevant control (instead of events of the subform as a control or as a form)

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Form Events (Access 2003 (2000 format))

    None of these events happen either when moving between the forms.

    Because the mouse will be used to move between the forms, I can use the Click events for likely controls, then the refresh method to save the record. This seems to work.
    Regards
    John



  6. #6
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Form Events (Access 2003 (2000 format))

    When I switch back and forth between open forms with the mouse (in Access 2002), the Activate and Deactivate events fire (whether I click on a control or just on a blank area of the form). Are you sure those events aren't firing?

    I wouldn't think the PopUp setting would affect this, but if it does, perhaps you can do without having PopUp set to Yes for the 2nd form.

    [EDITED ADDITION:] I should have mentioned that (1) I did my checking on two forms with datasheet (rather than continuous) subforms, and (2) that it's the Activate event of the main form (not the subform) that fires as I switch back and forth -- even if it's the subform I click on.

  7. #7
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Form Events (Access 2003 (2000 format))

    Yes I am sure those events are not firing.
    When I make the form not a popup they do fire. I want the second form to be a popup because I want it to sit in front of the other form at the foot of the screen.
    Regards
    John



  8. #8
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Form Events (Access 2003 (2000 format))

    Confirmed. Access 2002 is the same. Quite a "feature" for a non-modal PopUp form to have. Not only doesn't its Activate event fire when you activate it, neither does the Deactivate event of the form you left.

Posting Permissions

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