Even though Access is the best rapid development tool for databases I have ever
used, some things can be drudgery. Take Form Controls for example. Access names
the controls on a form the same as the control source. This makes it easy to have
errors. You may try to use the name of the control in an expression but Access reads
it as the name of the field. To avoid errors like this we have to go through the
controls on a form and rename them one at a time. This can really slow down development
and it gets to be drudgery after a few forms. So to save myself some time I wrote
the following procedure which renames the most used controls on a form in an instant.
The code works by looping through the various controls on a form and adding an appropriate
prefix to the existing name. You can run the procedure from the Immediate Window
using the following code:
Below is the procedure that does all the work. All you need to do is add it to a
Standard Module and call it using the name of your form.
This code even names the labels! You may want to change the caption or format a
label in some situations and this makes it much easier to manage.
I hope this code can help you make your Access development work a little easier
We use Microsoft Azure SQL Databases to provide safe and affordable 24/7 internet access to your company's vital information.
Contact us for a Free Consultation, feedback, or more information:
Page layouts based on Matthew James Taylor's Perfect multi-column CSS liquid layouts