Results 1 to 5 of 5
  1. #1
    TenOc is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    94

    I am confused about events GotFocus, Upload, Activate, Exit, loss focus etc


    I have a form that has tabs with 5 subforms. I want an event to happen when the user moves from one tab subform to the other tab subform. I have read the description about different events, but I am still somewhat confused. Often the user will only read the information on one subform before moving to the next subform. Other time the user will edit information on one tab them move the another tab. The user moves between the subform by clicking on a tab.

    What is the control name of the tab? Is it the name of the subform (which is the name displayed in the tab)? Is OnClick "tab name" the best event?

    What is the best event to use to trigger the action I want. I thought about "loss focus" but this event deals with "a control on the main form"???? The event I want is when the user leaves the old subform and moves to the new subform that may or may not have had the focus before.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    the name of the tab is in the properties. everything is in properties.
    you dont want Lost Focus, the user could click anything else, but what are you wanting to happen in the event?

    If user clicks a subform, use ON ENTER event
    in master form design mode, select the subform, (only the frame of the subform should be selected)
    view property events,
    select ON ENTER event
    put your event here

    If you use TAB control, you can also put events when user changes tab, TabCtl_Change() event

  3. #3
    TenOc is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Feb 2015
    Posts
    94
    Quote Originally Posted by ranman256 View Post
    If user clicks a subform, use ON ENTER event
    in master form design mode, select the subform, (only the frame of the subform should be selected)
    view property events,
    select ON ENTER event
    put your event here
    If the user only clicks on the tab and never clicks in the form -- he only reads information on the subform, is the ON ENTER event of the subform triggered since the property (name) of the tab is different from the property (name) of the subform?

  4. #4
    Minty is offline VIP
    Windows 10 Access 2016
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    On a tabbed form the changes in the selected tab fire the tab control On Change event.

    Each tab on the tab control has a page name that can be referred to.
    So you know which tab they are on and have just clicked regardless of what other controls they may or may not have clicked into on that tab.

    Does that help ?
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,791
    Dontcha just love that we have tabs on navigation controls on navigation forms and tabs on tab controls, which by the way, are not really tabs but pages?? We could be talking about either here. Wish I had a dollar for every time the problem turned out to be the other. I think the first line of post 2 is a good way of knowing what's what and I'll keep it in mind for future reference. Here's where you can find virtually anything you want to know about objects and their events, methods and properties. Of course, it helps to know what you're looking for, but as long as you know you're dealing with a tab control, you can drill down to pages and discover they're not called tabs at all in code.

    https://docs.microsoft.com/en-us/off...s/object-model
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 5
    Last Post: 01-14-2018, 02:29 PM
  2. Replies: 14
    Last Post: 09-15-2017, 11:25 AM
  3. GotFocus to open a form
    By NISMOJim in forum Programming
    Replies: 4
    Last Post: 09-18-2015, 06:11 PM
  4. Replies: 2
    Last Post: 12-20-2012, 03:06 PM
  5. Replies: 7
    Last Post: 07-15-2011, 08:14 AM

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