Solved

Using Me! versus Me. in Access VBA

Posted on 2010-09-01
6
878 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
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 58
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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

636 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