"me." doesn't work

  • Thread starter Thread starter accesswanabe
  • Start date Start date
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.
 
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?
 
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.
 
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!
 
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 :-)
 
Back
Top