In this session, Adolph Dupré discussed some powerful techniques for using class modules.
He explained when you may want to use classes instead of User Defined Types (UDT). For example to manage the data in unbound forms.
Adolph then demonstrated VBA code to create class modules from tables and use the class created to populate/navigate/update a simple unbound form.
A PDF of the presentation together with the sample database is avaqilable for download at https://www.isladogs.co.uk/aeu-27
Times:
00:00 Welcome from Colin
00:54 Adolph's intro
01:27 Presentation starts
02:01 What's a class object in Access?
03:20 Some more benefits of classes
04:29 MVC architecture
05:37 When to consider using a class
07:08 Example database - table & field naming convention
08:26 Review of class module code based on a table
10:49 Explanation of function to create class module from a table
14:05 Run function - new class created instantly
14:44 Example 1 - use class with form
17:39 Code behind the unbound form
21:39 Q1: Melvin - What if you use multiple tables for your form?
22:46 Q2: Ben - Can this be ported to Excel?
23:16 Adrian/Neil/Adolph - Discussion on the automatic population of the ID field in Access / SQL Server etc
27:10 Use of boilerplate code Find+Replace to simplify code writing
29:48 Example 2 - create class for large table with many fields
31:20 Q3: Neil/Ade -Could use public variables instead of Lets/Gets
33:33 Q4: Tim F - Lets/Gets allow for code validation checks to be added
34:43 Adolph - More on the ID field
35:17 Conclusion and thanks
36:26 Download links
36:45 Next month (Wed 5 June): Colin Riddingtom - IMEX Data Tasks & Extended File Properties
38:05 Further comments about using code to create code
38:40 Future events - download an .ICS calendar file to schedule future meetings in Outlook
39:52 Access Lunchtime meeting on Tues 30 April discussed new Discord server channel for Access: / discord
41:12 Call for AEU presenters in 2025
41:28 Previous AUG Europe video playlist on YouTube: https://www.youtube.com/playlist?list...
42:19 End