Access™ 2007 VBA Programmer's Reference
by Teresa Hennig, Rob Cooper, Geoffrey Griffith, Armen Stein
K.2. Reserved Words with Error Messages
You might wonder why you can't simply use a tool that will check against your custom list of reserved words and give you a timely and specific error message as you are creating your tables and adding fields. Although that seems like a great idea, it wouldn't be easy to implement. The Access team recognizes the merit in the concept, though, and has instituted an automatic check for a limited number of terms that are commonly used in both VBA and as field names. At this time, the list contains only six words:
| Name | Value | Text |
| Date | Year | Month |
Nonetheless, the seed has been planted, so to speak.
Keep in mind that you might circumvent this built-in check if you are creating a table in code. Access performs the check and generates the appropriate error message when you are creating a new table in the Access UI (see Figure K-2). However, you won't trigger the error if you create a table using CreateTableDef or the CREATE TABLE statement.
Figure K.2. Figure K-2
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