Results 1 to 8 of 8
  1. #1
    Chuck55 is offline Novice
    Windows XP Access 2000
    Join Date
    Apr 2012
    Posts
    25

    tab control - firing a page on-click event

    How can the on-click event of a page in a tab control be fired?

    I have created the page on-click event and the event code. (I did so by left clicking on the page name tab > right clicking on "Properties" which displayed "Page:" in the upper left corner of the properties box > clicking "on event" tab and selecting "on-click"). When the form is in form view and the page tab clicked, the event never gets the focus. I did place a stop in the left margin at the start of the event.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Most developers have found the OnClick event ofn the page almost useless. We use the OnChange event of the TabControl instead and then figure out what Page was clicked on.

  3. #3
    Chuck55 is offline Novice
    Windows XP Access 2000
    Join Date
    Apr 2012
    Posts
    25
    I do not see the OnChange event for the TabControl. In design mode, clicking on different areas of the TabControl, I found two sections, Page and Section w both having the same 5 events but no OnChange. I am using Access 2000.

    Am I not going through the right steps to find OnChange for the TabControl? Is there another procedure to determine what page has been selected?

    ps - this summer I will be in Colorado, for four months, at 8,500 feet.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I don't have ac2K but try Access usually gives a name like TabCtl.. to the object. See if you can find it another way.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    I found this from missinglinq and Bob Larson ( http://www.access-programmers.co.uk/.../t-164828.html )
    Hope it's helpful
    Code:
    Private Sub YourTabbedControl_Change()
      Select Case YourTabbedControl 
            Case 0  'First Page
                   'Code for Page 1
           Case 1  'Second page
                   'Code for Page 2
           Case 2   'Third page
                  'Code for Page 3
         End Select
    End Sub

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    When you view the Properties dialog there is a ComboBox at the top of the dialog that will let you move to the objects on the form.

  7. #7
    Chuck55 is offline Novice
    Windows XP Access 2000
    Join Date
    Apr 2012
    Posts
    25
    Problem solved. I was able to access the properties for the TabControl by clicking on the blank section to the right of the last page tab and by clicking on the edge of the TabControl. I created an OnChange event that did what I needed.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Excellent! Thanks for the update.

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

Similar Threads

  1. List Box Click Event
    By bginhb in forum Forms
    Replies: 3
    Last Post: 04-09-2012, 02:06 PM
  2. Replies: 3
    Last Post: 03-29-2012, 12:40 PM
  3. Replies: 5
    Last Post: 03-02-2012, 04:43 PM
  4. Form level mouseup event not firing
    By Philhoop in forum Forms
    Replies: 3
    Last Post: 07-22-2010, 09:41 AM
  5. Replies: 1
    Last Post: 05-31-2010, 05:18 PM

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