Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Reports / Printing / January 2006

Tip: Looking for answers? Try searching our database.

A ? about this groups conventions ??

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Klutzz - 07 Jan 2006 14:25 GMT
I have been looking around here for a solution to a problem that I am having
with a report in access 2003.
Many of the suggested code snips are similer to the following:
Me.linMaxFlowRate.Visible = (Me.txtMaxFlowRate > 2000)

My question is this; is the "Me" in the code a generic reference to the
report or element name or is it used as some sort of recognised naming
convention that tells the report that it is referring to itsself ??
Jeff Boyce - 07 Jan 2006 14:50 GMT
I'm not sure I understand the distinction you asked about.

When I use Me. (or Me! for objects I've created), I'm using it to refer to
the "container" object within which the code is running.  In other words,
Me. is a shorthand way of referring explicitly to the form (or report)
within which the code runs, and refers to Access-derived methods/properties.

I use Me! when I'm referring to controls I've added in, so I would have
written the example you gave as:

 Me!linMaxFlowRate.Visible = (Me!txtMaxFlowRate > 2000)

Signature

Regards

Jeff Boyce
<Office/Access MVP>

> I have been looking around here for a solution to a problem that I am having
> with a report in access 2003.
[quoted text clipped - 4 lines]
> report or element name or is it used as some sort of recognised naming
> convention that tells the report that it is referring to itsself ??
Allen Browne - 07 Jan 2006 14:52 GMT
You can think of "Me" as a reference to the form or report in which this
code occurs. It works only in code.

I did not pick up the Me topic in the VBA window of Access 2003, so here is
the text from the topic in Access 97:

----------------------quote------------------
You can use the Me property in Visual Basic to refer to a form, report, (or
to the form or report associated with a subform or subreport), or class
module where Visual Basic code is currently running.

Setting

The Me property is available only by using Visual Basic and is read-only in
all views.

Remarks

The Me property contains an object reference to the current form or report
and is faster than a fully qualified object reference. For example, the
following two code fragments refer to the value of the LastName control for
the current record on the Employees form:

strLastName = Forms!Employees.LastName

strLastName = Me!LastName

In most cases, the form or report referred to by the Me property is the same
form or report referred to by the ActiveForm or ActiveReport properties of
the Screen object. However, these properties refer to the form or report
with the focus, whereas the Me property always refers to the form or report
in which code is running. For example, a Timer event can occur in a form
that doesn't have the focus. When that happens, the code Screen.ActiveForm
refers to the form with the focus, and the Me property refers to the form in
which the Timer event occurred. Therefore, when you are creating generic
procedures that operate on the current form, the preferred method is to pass
the form to the procedure by using the Me property rather than the
ActiveForm property.

You can use the Me keyword in class modules to refer to the current instance
of that class. Just as you use Me in form or report class modules to
retrieve a reference to the current form or report, you use Me in a class
module to retrieve a reference to the current class module object.
------------------end quote--------------------------------

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

>I have been looking around here for a solution to a problem that I am
>having
[quoted text clipped - 5 lines]
> report or element name or is it used as some sort of recognised naming
> convention that tells the report that it is referring to itsself ??
Klutzz - 07 Jan 2006 15:23 GMT
Thanx Allen ! thats what i was needing to know. it is a key word vs. a way of
expressing the code in an example such as "foo.2foo.xfoo" or what ever it is
you "Gurus" use to show us newbies a representation of the code witout
knowing all the actual user specific names for reports, tables, controls etc.

Thanx
Klutzz

> You can think of "Me" as a reference to the form or report in which this
> code occurs. It works only in code.
[quoted text clipped - 50 lines]
> > report or element name or is it used as some sort of recognised naming
> > convention that tells the report that it is referring to itsself ??
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.