AP: The Power of Sub Classes in VBA with Kent Gorrell

Поделиться
HTML-код
  • Опубликовано: 23 июл 2024
  • Overview: Introduction to Form and Control Sub Classes
    Examples of how to create a consistent User Experience with very little code.
    These examples should get you thinking about what else you could do in your applications.
    Longer Version: Exploration of the Form and Control Sub Classes
    Implementing Form and Control Sub Classing examples to make your applications consistent with very little code. You’ll learn about the following.
    Raising Events to enable and disable buttons like Save and Undo when you edit or save a record
    Using a Button class to do the saving and undoing with no code behind your button or form
    Text Box Class to highlight the current control without using Format Conditions
    Change the on focus background color for you entire application in just one place
    Use a different on focus background color for locked or unlocked controls
    Prevent illegal characters like a-z in date controls
    And plenty more
    And all with as little as 3 lines of code behind each form
    The sample application is available for download; it’s yours to download and keep. You'll find it on the Member Dashboard at AUG Pacific: accessusergroups.org/pacific/...
    Table of Contents:
    00:00 - Introduction
    00:29 - Intro Kent Gorrell, The Power of VBA subclassing
    00:35 - Building on John Colby's original work on classes
    01:01 - Reference to Eric Blomquist's discussion of Access classes
    01:18 - Make ALL of your forms consistent and easily maintained with Classes
    02:09 - Subclassing makes for easier maintenance and enhancement
    02:32 - Raise events in the subclass and let the subclass handle them all the same way
    03:16 - Q: What is a Subclass? (explanation deferred)
    03:37 - 1st Demo of a basic Customer Form with subclasses
    04:00 - Labels on control buttons respond to changes in the form
    04:25 - Code review and walk through
    04:49 - What is a subclass explained
    04:52 - The Form itself Is a class. Class code invoked there is its subclass
    05:00 - The form declares and calls a sub class with extended events
    05:17 - Subclassing can also apply to controls
    05:31 - Form subclass in turn instantiates control subclass for controls on that form
    06:06 - 2nd Demo of a form with control subclasses
    12:10 - Revisit explanation of subclasses
    12:39 - Create a separate instance of each class
    12:45 - A standard module code is shared by all forms, each subclass instance is unique to that form
    13:11 - How Control subclasses work
    14:09 - A form's Property Sheet shows [Event Procedure] when an event has been added for it
    14:25 - Demo and walk through of a control subclass
    14:33 - Create one instance of each control for each form on which the control is used
    14:58 - 3rd Demo of the button subclass
    16:31 - Subclass events run in addition to any events defined in the form's class
    16:43 - If an event already exists in the control's event, both are run
    17:42 - The beauty of the class is one place to update or enhance all forms
    19:03 - 4th Demo of subclasses for text & combo box controls
    19:24 - Better than conditional formatting because changes are made once, in one place in the code
    20:11 - Use combo box .ListCount to fully populate the records shown
    21:33 - Highlight for control's labels when controls don't have their own background color
    24:13 - Identifying and using data typing in subclasses
    26:02 - Reusable code is one line
    26:50 - Audience question & answer about listbox subclass
    27:16 - We want consistent behavior in all similar forms; classes enable that
    29:30 - New controls pick up existing subclass behavior simply by being on the form
    32:00 - Code to throw away invalid characters in a control (such as a date)
    34:49 - New controls acquire existing functionality when added
    35:40 - Managing "Form" Background color using a subclass and a textbox conrol
    37:27 - Use a class to toggle Dev/runtime features
    37:30 - Controls with Tag "Dev" follow State selected (dev or runtime)
    37:55 - Late binding for sub forms in subclasses
    40:09 - Summary of presentation and overview of possible uses
    40:29 - Using the CodeContextObject
    42:42 - Additional points relevant to using subforms on tab controls
    47:03 - Adding highlighting to continuous forms
    52:47 - Replace delete with active/inactive using a pair of fields and a subclass
    55:52 - Summary of VBA Subclassing in this presentation
    56:42 - The bottom line: consistent, but easily updateable behavior across an application or suite of applications

Комментарии • 3

  • @LearnAccessByCrystal
    @LearnAccessByCrystal 5 месяцев назад +1

    thanks, Kent! Great presentation :)

  • @gregoryregan3000
    @gregoryregan3000 6 месяцев назад +3

    Very helpful presentation. Thanks, Kent.

    • @AccessUserGroups
      @AccessUserGroups  6 месяцев назад +1

      Thank you for watching. Please join us at accessusergroups.org/ to stay abreast of current presentations.