Solved

Using Me! versus Me. in Access VBA

Posted on 2010-09-01
6
865 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 - Microsoft MVP, Access and Data Platform) 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

679 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