Disambiguating references...

  • Thread starter Thread starter Fred Boer
  • Start date Start date
F

Fred Boer

Hello!

I saw a post the other day discussing disambiguation, and I thought, hmm....
I should do that. It should be easy using find and replace. I found a list
of objects that would need this, and I did a quick find/replace to change
all my "Recordsets" to "DAO.Recordsets". Worked fine; compiled properly.
Then I saw that on the list of the objects was "Error". OK, all my subs have
a line "On Error GoTo...", so I tried replacing "Error" with "DAO.Error". No
good; compiling throws a message about "Method or data error...".

I am quite certain I am doing something stupid here, but would someone mind
explaining how I am being wrong-headed? <g>

Thanks!

Fred Boer
 
In this case, Error is not an object but a condition. Thus, you don't need
disambiguation.
 
Fred said:
I saw a post the other day discussing disambiguation, and I thought, hmm....
I should do that. It should be easy using find and replace. I found a list
of objects that would need this, and I did a quick find/replace to change
all my "Recordsets" to "DAO.Recordsets". Worked fine; compiled properly.
Then I saw that on the list of the objects was "Error". OK, all my subs have
a line "On Error GoTo...", so I tried replacing "Error" with "DAO.Error". No
good; compiling throws a message about "Method or data error...".

I am quite certain I am doing something stupid here, but would someone mind
explaining how I am being wrong-headed? <g>


Yo, Fred, a replace all might make a mess of your program
comments (you have lots of comments, right ;-)). Actually,
you only need to do this on Dim, Public and Private
statements.
 
The word "Error", in an "On Error GoTo" statement, is a keyword - like the
"On" and "GoTo". It is looked-up in an internal table within the Access
codefile. It does not need to be looked-up in an external library.

Disambiguation is to reduce confusion when some word (object, method,
property or constant) exists in several different Libraries, and Access
needs to choose which of those libraries to look-up that word in.

HTH,
TC
 
You know, last night I woke up and sat bolt upright in the middle of the
night with the thought, "I need to go to the bathroom....".... but I *also*
was thinking..."I bet I only need disambiguation when I'm declaring
something with dim, public or private...". Thanks to all of you for clearing
that up for me!

And Marsh, I *did* make a mess of my comments.. but I went to a backup and
started over... ;)

Many thanks!

Fred
 
Back
Top