When I'm writing code for my open form in Access 2003 should I use Me.ControlName or just the ControlName

When I'm writing code for my open form in Access 2003 should I use Me.ControlName or just the ControlName? Is one better than the other? Or doesn't it really matter?
Ian LeasonAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dale FyeOwner, Developing Solutions LLCCommented:
It is recommended to use the me.ControlName syntax.

Oh, and make sure you are using a control naming convention that allows you to tell what type of control you are working with.  By default, Access will give the control the name of the field it is bound to, but if this is a textbox, I recommend prefacing it with "txt_".  If a combo, use "cbo_"

I use my own variant of the Reddick method

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Ian LeasonAuthor Commented:
That is brilliant, thank you!
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
I would add that either will work, but as a general rule of thumb, you *always* want to be as explicit as possible in a programming language.

 Also, this would lead to less possible bugs.  For example:

 TransDate = Now()

 But was that supposed to be Me.TransDate or rst![TransDate] (since you were working with a record set at the time as well)?    If your not explicit, you leave the door open more for mistakes to be made.

 I would also take five minutes and have a look at this:


 for a few more pointers in writing VBA code.

Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

Ian LeasonAuthor Commented:
Thank you Jim.
In addition, using Me invokes IntelliSense, which helps to prevent misspellings when you're not sure of the control name.

Ian LeasonAuthor Commented:
I never thought of that, thank you Ron.
@Jim Dettman,  Great video tutorial you made there, Jim.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.