[AccessD] Omission of Me

Charlotte Foust cfoust at infostatsystems.com
Thu Jul 5 15:03:11 CDT 2007


I don't recall it being absolutely required in any of VBA versions, but
I could be wrong about A95.  In theory, there's a penalty for not using
it because the application has to figure out whether you're referring to
a control, a field or a variable on the fly, which means if you don't
have option explicit set on, it will assume any misspelling is a new
variable.

Charlotte Foust 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Susan Harkins
Sent: Thursday, July 05, 2007 10:59 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Omission of Me

I always use Me because I don't know what version readers are using. It
seems to me that its possible to drop Me in certain cases. 

If IsNull(cboSubject) Then
    MsgBox "Please select a subject", vbOKOnly, "Error"
    Exit Sub
End If

The above's the only thing I can come up with -- in older versions,
wasn't the Me identifier required before the control, as in the
following:

If IsNull(Me.cboSubject) Then

Or, am I just making stuff up again? 

Susan H. 

What do you mean by "dropped the need for"?  The Me and the other forms
of identifiers tell the database engine what it's dealing with so that
intellisense is available and syntax checking knows enough to blow up on
a misspelling or squawk if the Option Explicit is set on.

Charlotte Foust 


--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list