Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 908
  • Last Modified:

Using Me! versus Me. in Access VBA

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
newbie46
Asked:
newbie46
  • 4
2 Solutions
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
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
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
"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
 
Brad HoweCommented:
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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
Using Bang is the old way, dot the new way (and is faster).  I still use bang out of habit.
JimD.
0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now