Access™ 2007 VBA Programmer's Reference
by Teresa Hennig, Rob Cooper, Geoffrey Griffith, Armen Stein
L.5. More Do's and Don'ts
By now, you'd think that all the basics have been covered, but of course, there is always more. So, just for good measure, here are a few more do's and don'ts:
When creating a new tag, stick to existing rules and styles for length, case, and so forth.
Don't redefine an existing tag. Either create a new unique tag or find an existing tag that fits the purpose.
Before creating a new tag, review existing tags. There is likely already a tag that covers the situation.
Don't use ID as a prefix or suffix.
Because ADO, ADOX, and DAO share some of the same tags, it is a good idea to specify the library name. In addition to avoiding confusion, explicitly naming the library will make the code run faster. For example, to specify that it is an ADO record set, you might write:
Dim rst As ADODB.Recordset
And to specify that you are using ADOX, you might write:
Dim idx As ADOX.Index
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access