Me!

N

Natalie

I read a few postings and they a syntax with Me!. For example...
Me!ControlName.Colomn().

What does that mean exactly?
Sorry, I'm a newbie to acess databases.
 
J

Jeff C

Me! is the code reference used when referring to the form the code is placed
in.
 
G

Graham R Seach

Me is actually an intrinsic reference to the current top-level container
object, which could be a form, report or class.

In a form, Me refers to the current form instance. In a report, Me refers to
the current report instance. In a class, Me refers to the current instance
of the object which is derived from the base class.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
 
T

Tim Ferguson

I read a few postings and they a syntax with Me!. For example...
Me!ControlName.Colomn().

You've had explanations of the Me part, but I wonder if you are asking
about the ! (shriek) operator.

Most of the time, you get to the properties of an object using the .
(dot) operator -- MyControl.BackColor and so on.

Most object have one property that is a Default Property and this is what
you get if you don't specifiy which property you want: myString =
myControl is the same as myString = myControl.Value because that is the
default property of the Control object.

Some objects have a default Collection too; therefore myForm("MyTextBox")
is the same as myForm.Controls("MyTextBox") because Controls is the
default collection for the Form object.

The shorthand method for indexing into the default collection is to use
the shriek operator, so that myForm!MyTextBox is the same thing. It's
quite a shortcut too...

myString = MyForm!MyTextBox

is the same as the much longer

myString = MyForm.Controls("MyTextBox").Value


Hope that helps



Tim F
 
N

Natalie

Thanks guys!!! Think I got it now. :)

Tim Ferguson said:
You've had explanations of the Me part, but I wonder if you are asking
about the ! (shriek) operator.

Most of the time, you get to the properties of an object using the .
(dot) operator -- MyControl.BackColor and so on.

Most object have one property that is a Default Property and this is what
you get if you don't specifiy which property you want: myString =
myControl is the same as myString = myControl.Value because that is the
default property of the Control object.

Some objects have a default Collection too; therefore myForm("MyTextBox")
is the same as myForm.Controls("MyTextBox") because Controls is the
default collection for the Form object.

The shorthand method for indexing into the default collection is to use
the shriek operator, so that myForm!MyTextBox is the same thing. It's
quite a shortcut too...

myString = MyForm!MyTextBox

is the same as the much longer

myString = MyForm.Controls("MyTextBox").Value


Hope that helps



Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top