I am DaoBoy!
After learning to move around in Microsoft Access, (creating tables, designing forms, writing reports, etc); I really wanted to get under the hood and understand the internal workings, regardless of the "User Interface".
This brought me on an odyssey known as DAO (Data Access Objects).
With DAO, you can do things in Microsoft Access using a more traditional style of programming.
Description:
- Displays every property of the field you select.
- Beginning DAO.
- DaoBoy01
This program displays every property of each field you select. Click on the MSDN button, and it will take you to the Microsoft Developer Network DAO Properties for Microsoft Jet Workspaces.
Notes:
- AutoKeys
In every Microsoft Access application I write, I have a macro called "AutoKeys".
F4 = Properties
F7 = View Code (and maximize window)
F12= Close
These keys don't always work in every circumstance, but I've grown accustomed to knowing when they can be used.
- Row Source Type = Field List
The listbox on the left has a "Row Source Type" of "Field List".
This program is the only time I've ever used this particular feature.
- Row Source Type = Value List
The listbox on the right has 2 columns: Property and Value. So the RowSource must look something like: "Property;Value;Type;4;Name;Table1LongInteger;etc;etc"
This means that special care must be given to those values with semicolons.
- VBA Code
The listbox on the right is populated by writing VBA (Visual Basic for Applications) code using the DAO object model.
It displays every property of the field you have selected on the left. You can view this code by pressing the "View Code" button on the form.
- FieldList.Column
To get the name of the field you have selected in the Listbox "FieldList", you must reference:
FieldList.Column(FieldList.ListIndex), because FieldList.ListIndex is merely the number of rows down you are in the list.
- On Error
For whatever reason, there are many properties that don't have a value. When trying to reference these values, the program would generate an error. The "On Error" condition lists the description of the error in the value column.
- Const Q = """"
Q is one of those generic variables (constants, whatever) that I always use. It's easier to reference "Q" instead of CHR(34).
- Standards
While writing this, I got sidetracked on how to standardize each project. There is a lot of code in here not referenced, but will be used in later samples.
- No Exit_Click() subroutine
It's not there because I used the Expression Builder, not an Event Procedure.
Just thought I'd throw it in for the fun of it!
- DaoBoy02
This program has no code behind it, but displays a series of memos explaining how one would go about enumerating all the properties of all the fields of all the tables.
email: Phillip Senn
or Download all the examples
visit: DaoBoys home