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

Get Access™ 2007 VBA Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.