Solved

Using Me! versus Me. in Access VBA

Posted on 2010-09-01
6
857 Views
Last Modified: 2012-05-10
I was once told that when accessing Access controls, whether unbound or bound, it is preferred to use Me!, as opposed to Me. . Yet, when using Me. for unbound or bound controls, VBA does recognize the control name.

Is there a rule of thumb to follow?

Thanks.
0
Comment
Question by:newbie46
  • 4
6 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 250 total points
ID: 33583340
You are in luck.  The Definitive Document has just been almost finalized:

http://www.experts-exchange.com/Microsoft/Development/MS_Access/Q_26420505.html?cid=748#a33571144

See this post near the bottom:

 LPurvis:
09.01.2010 at 05:03AM PDT, ID: 33575882

Much better. Small comments attached. (The document page setup is always way too narrow for me to read the wide tables when I receive it - just thought I'd mention that here).
             
DBPQ.Rev1LP.doc (52 KB) (File Type Details)

****

EVERYTHING ... you need to know about this subject is spelled out in the Doc.  Read thoroughly.

mx
0
 
LVL 75
ID: 33583345
"it is preferred to use Me!, '

Not really the case ... as you will see in the link I posted above.

DOT allows Intellisense to expose the control names because of Early Binding, BANG does not.

As you will see, there are very few places where Bang is necessary.

mx
0
 
LVL 30

Assisted Solution

by:Brad Howe
Brad Howe earned 250 total points
ID: 33583364
Hi,
I know Me! refers to an object and Me. refers to a property. Now when to use them varies, they both work in either format.
Here are some good articles on the subject.
http://bytes.com/topic/access/insights/620587-control-object-reference-me
 http://blogs.msdn.com/b/access/archive/2008/05/30/dot-or-bang.aspx
Cheers, Hades666
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 75
ID: 33583455
hades666:  I highly recommend you read the Doc in the EE link I posted.  Your comment is not quite accurate.  The document was edited by Leigh Purvis, one of been minds in the entire Access World.

mx
0
 
LVL 57
ID: 33585345
Using Bang is the old way, dot the new way (and is faster).  I still use bang out of habit.
JimD.
0
 
LVL 75
ID: 33589127
JD ... I suggest reading the doc that Leigh and Miles put together.  It's pretty darn good and covers every case :-)

mx
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question