Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Warrington, Cheshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I've got a main form with a sub-form. I need to detect when the user 'leaves' the sub-form by clicking in any of the controls on the main form and I also want to detect when the user clicks back on any control in in the sub-form.

    I've tried the On Exit and On Entry events applied to the sub-form control in the main form, and I've tried the On Lost Focus and On Got Focus events applied to the sub-form itself. However, nothing seems to trigger.

    What am I doing wrong and how can I detect these actions, please?
    Thanks
    Silverback
    Silverback

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Open the main form in design view.
    Click once on the subform to select it.
    Do *not* click on the subform again because that would select an item in the subform.
    Activate the Event tab of the Properties window.
    The On Enter and On Exit events that you see here are the ones that occur when the user enters and exits the subform.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Warrington, Cheshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Oh dear. I'm really getting too old for this. I need a new brain.
    So I looked at your reply and thought, but I've already done that and it didn't work, but I'd better try it again. Of course, it worked.
    Only then did I realise that in my previous attempt I had set up On Exit and On Entry code events for a different sub form, not for the sub form I'm interested in.

    Humble apologies for wasting your time.
    Silverback
    Silverback

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Oops! Well, it happens to all of us...

Posting Permissions

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