Anyway, this sub-form references some objects on the parent form. Those same named objects exist on the sub-form, so I thought why don't I do this:
Expand|Select|Wrap|Line Numbers
- dim obj as object
- set obj = Me
Expand|Select|Wrap|Line Numbers
- me.parent.controlname ...
- to
- obj.controlname
Expand|Select|Wrap|Line Numbers
- set obj = me
- to
- set obj = me.parent
I tried this experiment. I changed an object name from "Salesman_filter" to "Tsalesman_filter", and I changed my code from Me.Salesman_filter to Me.Tsalesman_filter, and then the compiler was happy. The compile error was now reported a few lines further down on a reference to another object. I changed Tsalesman_filter back to Salesman_filter and the compiler was still happy with the Me. reference, but still unhappy with the following reference to a different object.
So very weird. Then I tried changing the Me. references to Me! references, and the compiler stopped seeing an error. I changed all my Me. references to Me! references and no more errors.
What in the world happened? Can any of you explain this?
Thanks!