April 4th, 2006
That’s right, it looks like it’s going to be a beautiful day in my neck of the woods. To celebrate, I have a new Tip of the Day and an article for Microsoft Access for you.
Tags: access,
controls,
forms,
Microsoft Access
Posted in Site Updates | 2 Comments »
April 4th, 2006
Picture this: You’ve just inherited a database from its previous owner. You’re new to the project, but you have substantial database experience. Opening up the database for the first time, you begin to take a look around some of the forms to try to get a feel for how everything works. The first Control you look at is named “Text9″. Trembling, you look at the next one: “Label7″. This is when the horror sets in.
Does this sound familiar? If you’ve ever been in an experience like this, then you know how important it is to take the time to name your Controls. In case you’ve never been in this situation, here are three compelling reasons why you should do this:
- It will make it easier for others to learn how the database works -Descriptive names will allow someone who may have subject matter expertise but no experience with your database to pick up the structure quickly.
- It will make the database more maintainable - This somewhat coincides with the first point, except it also applies to you. If you have worked on a part of the database for a few months and then suddenly you have to fix or change something, meaningful names will allow you to get right back into the swing of things.
- It will keep you sane - This is absolute truth. When you’re knee-deep in development, trying to work with “Text9″ and “Label11″ is going to drive you mad. Do yourself a favor before you go off the deep end.
Note: For our purposes, we’ll define a Control as pretty much any item you can place on a Form. Some examples of this would be a list box, text box, label, etc. Basically, anything that you put on a form should have a meaningful name.
There are two basic parts of naming a Control: Physically naming the control, and naming conventions. These are described below.
How To Name a Control
This is simple. First, right click on the Control you want to name and select Properties (Alternatively, you can double-click on it). The window pictured below should open (in this example I used a Text Box).

The part circled in red is what we are concerned about. This is the Name field, and this is where you will be making your edits. When you’re done making the edit, simply close the dialog box and your changes will be saved.
Naming Conventions
If you have any programming experience, naming a control can be likened to naming variables. If not, don’t worry, it’s a simple concept to grasp. When you name your controls, you want to adopt the same Naming Convention for each control. A Naming Convention is basically the way in which you construct a name for each Control.
One example that I use is to capitalize the first letter in each separate word in the name. For instance, if I want to name a text box where the user enters their name, I might use “UserNameEntry” as the Control name. Alternatively, you could also use an underscore to separate the words, creating “User_Name_Entry”.
It is possible to use spaces in-between words, however I don’t advise this simply because it makes programming in the backend possibly harder since you have to make sure the full name is read when you reference it (if this seems Greek to you, don’t worry, it is more for the intermediate to advanced users). This is why I prefer the first example, since it is no hassle to use.
You can always come up with your own, just remember to be consistent and descriptive across the board.
Overall, the small amount of time it takes to name a Control properly is well worth it when compared the enormous amount of benefits that you’ll see.
Tags: access,
control,
design,
form,
Microsoft Access,
microsoft-office,
naming-convention
Posted in Microsoft Access, Microsoft Office Help | 2 Comments »
April 4th, 2006
This is something that I’m sure will make it into one of my articles, but I want to touch on it here. There is nothing that annoys me more than when I explain or give direction to someone, and then they come back 5 minutes later asking me the same questions because they forgot my answer. Take the extra 2 seconds and take notes when somebody explains something to you. Trust me, they will be much more willing to help you out in the future if they know you aren’t going to be bugging them all the time with the same questions.
Posted in Tip of the Day | 1 Comment »