FIGURE 13.13
A COM add-in question.
Saving the original control name to the Tag property can occasionally be useful, especially when
you are renaming controls in a database created by someone else, and you may need to know the
original control name in order to fix a reference later on. However, the default choice is No,
because mostly there is no need to save the original control name.
After selecting a choice, the code then proceeds to cycle through the open forms and, for each
form, cycle through its controls. For any control that doesn’t have the appropriate control prefix, a
new name is created, and presented for approval in a message box, as shown in Figure 13.14.
FIGURE 13.14
A proposed new control name.
Generally, the new name can be accepted as is; occasionally (for example, for labels with very
lengthy captions, or controls with expressions), the new name needs to be edited, which is done by
clicking No and then editing the control name in an InputBox.
Even in Access 2007, when you create a new bound form using the Form button in the Create tab
of the Ribbon, all bound controls will have the same names as their fields, which can lead to circu-
lar reference errors when running code. Thus, it is a good idea to run the Rename Form Controls
(or Rename Report Controls) command immediately after creating a bound form or report, before
writing any code that references its fields or controls.
Part III Adding More Functionality to Office