what is Me.?????

  • Thread starter Thread starter steve
  • Start date Start date
S

steve

I have used the Me.repaint etc in a few places. But I cant seem to see what
the "Me." acutally does. I understand what repaint does its the Me. Im
looking for info on. Can someone tell me what it does and when to use it.
What is it called so I can do a search to learn more about its use.

Regards
Steve

7willie
 
steve said:
I have used the Me.repaint etc in a few places. But I cant seem to see what
the "Me." acutally does. I understand what repaint does its the Me. Im
looking for info on. Can someone tell me what it does and when to use it.
What is it called so I can do a search to learn more about its use.

Regards
Steve

7willie

Steve,
To put it simply, Me is a VBA keyword, and refers to the active object.
Use it in a VBA code window in a Report, and it refers to that report.
Use it in a VBA code window in a Form and it refers to that form.

It avoids your having to write
forms!frmEmployees!LastName
each time you need to refer to the LastName control on the Form named
frmEmployee code sheet.
And it's easily portable to other code windows, as there is no need to
change the name of the object each time.

Notice my use of the word 'VBA'. It is a VBA keyword, not an Access
keyword, so you can not use it in a control source expression, and it
can not be used in a public Module.

Use Me! (the Bang) when you are refering to a member of the object, such
as a control on a form..
Me![CompanyName]

Use Me. (the Dot) when refering to a property of the object..
Me.Visible = False.

Hope this helps.

Oh, I almost forgot to tell you how you can find this information. Open
any VBA code window, type the word Me, place the cursor within the word,
and press F1. VBA help will open at that help file. Do this anytime you
need help on a function or word. it's simpler than searching.
 
Thanks this is a great help !!!

Regards
steve

fredg said:
steve said:
I have used the Me.repaint etc in a few places. But I cant seem to see what
the "Me." acutally does. I understand what repaint does its the Me. Im
looking for info on. Can someone tell me what it does and when to use it.
What is it called so I can do a search to learn more about its use.

Regards
Steve

7willie

Steve,
To put it simply, Me is a VBA keyword, and refers to the active object.
Use it in a VBA code window in a Report, and it refers to that report.
Use it in a VBA code window in a Form and it refers to that form.

It avoids your having to write
forms!frmEmployees!LastName
each time you need to refer to the LastName control on the Form named
frmEmployee code sheet.
And it's easily portable to other code windows, as there is no need to
change the name of the object each time.

Notice my use of the word 'VBA'. It is a VBA keyword, not an Access
keyword, so you can not use it in a control source expression, and it
can not be used in a public Module.

Use Me! (the Bang) when you are refering to a member of the object, such
as a control on a form..
Me![CompanyName]

Use Me. (the Dot) when refering to a property of the object..
Me.Visible = False.

Hope this helps.

Oh, I almost forgot to tell you how you can find this information. Open
any VBA code window, type the word Me, place the cursor within the word,
and press F1. VBA help will open at that help file. Do this anytime you
need help on a function or word. it's simpler than searching.
 
Back
Top