"me." doesn't work

A

accesswanabe

I write a lot of VBA. I find it very useful to start lines referring to the
object I'm writing with "me." so that I can get the list of properties and
methods. In the project I'm currently working on, this has suddenly stopped
working. I type "me." and nothing happens. I can't figure out if I've
accidentally disabled a feature or something like that. Anyone have any
ideas?

Thanks much in advance.
 
S

Stuart McCall

accesswanabe said:
I write a lot of VBA. I find it very useful to start lines referring to
the
object I'm writing with "me." so that I can get the list of properties and
methods. In the project I'm currently working on, this has suddenly
stopped
working. I type "me." and nothing happens. I can't figure out if I've
accidentally disabled a feature or something like that. Anyone have any
ideas?

Thanks much in advance.

Me will only work in class modules (ie forms, reports & standalone class
modules). Are you sure you're not attempting to use Me in a standard module?
 
A

accesswanabe

I use "me." in standard object modules all the time...works great. I
actually think I figured out the cause by commenting out code in my module
and using a process of elimination. In my variable declaration section I was
"Dim"ing a "Single" data type to variable name "TotalRecordCount". I
commented all lines except this variable declaration to nail it down to this
single line. I thought that I might have used the variable name in a public
declarations module, but that wasn't the case. I also looked for the name in
the reserved words list, but did not find it listed. When I Changed the
variable name to CurrentTotalRecordCount, "me." started working again. Not
quite sure what the scoop is with that, but would sure appreciate ideas from
anyone.
 
A

accesswanabe

Stuart, I owe ya an apology and a thanks because you got me thinking in the
right direction.

Yes, I was working on the module underlying a form so, I have been working
on a Class Module...my mistake for misdefining. Turns out that I very
sloppily tried to declare a variable with the same name as a table field for
the form's underlying recordset...a very basic no, no...slapped my hand for
ya.

And, that's why my username, accesswanabe, is so befitting!

Thanks again Stuart!
 
S

Stuart McCall

accesswanabe said:
Stuart, I owe ya an apology and a thanks because you got me thinking in
the
right direction.

Yes, I was working on the module underlying a form so, I have been working
on a Class Module...my mistake for misdefining. Turns out that I very
sloppily tried to declare a variable with the same name as a table field
for
the form's underlying recordset...a very basic no, no...slapped my hand
for
ya.

And, that's why my username, accesswanabe, is so befitting!

Thanks again Stuart!

No need for apologies. It's such an easy mistake to make. I should know,
I've made it myself often enough :)
 
T

trevorC via AccessMonster.com

If you have errors in your vba code and it won't compile, the me. won't work
until it's fixed.
 

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