+ Reply to Thread
Results 1 to 3 of 3

Replicating the Access Form.Dirty property for an Excel UserForm

  1. #1
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Replicating the Access Form.Dirty property for an Excel UserForm

    Good evening all.

    Does anyone have any bright ideas about replicating the Form.Dirty property from Access in Excel?

    I'm creating a workflow tool in Excel that utilises a UserForm to display records that are pulled from an Access database.

    Users will be able to amend the record details on the form and submit the changes to update the database.

    For info, it has to be in Excel as everyone in my organisation has that and not everyone has Access, even the Runtime version.

    It works by importing the results of a query (SQL in VBA) into a table in Excel. The form can then navigate between records using Prev/Next buttons but I don't want the user to be able to move to another record if they've made changes to the current one that haven't been saved/submitted.

    Short of a long-winded process using Enter and AfterUpdate events on each TextBox and ComboBox I'm stumped. My knowledge of Class modules is nowhere near up to this if that's even an option.

    Any help gratefully received!

    Beth.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Replicating the Access Form.Dirty property for an Excel UserForm

    Hi Beth,

    See the file associated with post #11 in the following thread: http://www.excelforum.com/excel-prog...matically.html

    It uses dynamic and static TextBoxes and assigns a class module as the event handler for the Text Boxes. Important items are highlighted in red.

    Implementation of the Class module is not trivial, but requires little understanding as use is entirely cookbook.

    There is a little known UserForm Control .Tag attribute that you can use to store anything you want. If you store the original TextBox value in each TextBox .tag attribute, you can then loop thru the controls to determine if the data is Dirty.

    The code for the above referenced post follows:
    In the file, Class Module 'Class4' contains the following code:
    Please Login or Register  to view this content.
    UserForm1 code module contains the following code:
    Please Login or Register  to view this content.

    Ordinary code module code (concatenated from 3 different code modules contains):
    Please Login or Register  to view this content.
    Lewis

  3. #3
    Valued Forum Contributor
    Join Date
    06-02-2012
    Location
    London, England
    MS-Off Ver
    365
    Posts
    397

    Re: Replicating the Access Form.Dirty property for an Excel UserForm

    Many thanks, Lewis.

    There's a lot going on there but I shall take some time to digest it and see if I can pick out the bits I need.

    Beth.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Access form works with access Viewer but not full version of Access?
    By Shanyn in forum Access Tables & Databases
    Replies: 1
    Last Post: 10-22-2014, 01:14 PM
  2. Replicating a Validated List Box on a User Form?
    By uberathlete in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-09-2014, 08:31 PM
  3. [SOLVED] User form - Can't set ControlSource property. Invalid property value.
    By Aland2929 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 07-26-2013, 05:29 AM
  4. How to access bitmap picture stored as property of image control on userform
    By Spere in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-17-2013, 05:41 PM
  5. Excel 2010 userform to access and edit the data in MS ACCESS DB tables
    By anand_y59 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-10-2012, 07:46 AM
  6. [SOLVED] Retrieve MS Access DDB Property in Excel VBA
    By ibeetb in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-26-2005, 08:05 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1