Trap On Dirty event on Tabbed Control

Posted on 2009-04-27
Last Modified: 2012-05-06
Is there any way to trap any change to a tabbed control page without having to code for each field/control on the page?  There is no "On Dirty" event for a tabbed control or a Page within the tabbed control.
Question by:chobe
    LVL 75

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    The Form On Dirty applies here ...

    LVL 28

    Expert Comment

    As DatabaseMX has stated the forms On Dirty Event applies when you move from page to page in the tab control as it states in the Access help file "The Dirty event occurs when the contents of a form or the text portion of a combo box changes. It also occurs when you move from one page to another page in a tab control."

    Not sure what you are doing in the OnDirty but if you are wanting to save as you go through the tabs then you can use the OnChange Event of the Tab Control and check the Dirty Property.

    Cheers, Andrew
    Private Sub TabCtl28_Change()
        If Me.Dirty Then
           Me.Dirty = False
        End If
    End Sub

    Open in new window


    Author Comment

    Sorry for the long absence....but as far as I can determine, there is is no On Change or On Dirty event for each individual page and the On Change (no On Dirty) event for the tab control only triggers when you change tabs - not change a field on a individual tab or page.  I have seen where coders haved trapped events in there coding even though there is no such event in the properties list.  Is that a correct assumption?
    LVL 75

    Accepted Solution

    The tab control and it's pages do not have a Dirty event because it (they) is not an editable control - like a text and combo box are.

    Some controls like the Microsoft Treeview control do not show all of the actual properties / events on the standard property sheet for the control.  You can only see them on code.


    Author Closing Comment

    Thanks DatabaseMX;  The proplem was really a problem with how I was trapping dirty events on the main form.  Once I fixed that issue, On Dirty applies to changes to the tab control as well.  Thanks for your assist!
    LVL 75

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    "Thanks DatabaseMX; The proplem was really a problem with how I was trapping dirty events on the main form. Once I fixed that issue, On Dirty applies to changes to the tab control as well. Thanks for your assist!"

    You are welcome.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
    Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now