O'Reilly logo

Access™ 2007 VBA Programmer's Reference by Armen Stein, Geoffrey Griffith, Rob Cooper, Teresa Hennig

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required