Is the Me. syntax required in form vba when referring to controls?

Thanks to all for your comments about comments. I agree that it's stupid to comment on obvious stuff, which my previous coder did, and that it's smart to comment on the why(s), which wasn't done. What really confused me is that the guy had a good mastery of SQL, basic logic, etc. but didn't know enough to put in error trapping, and then he released it for use by a department of six people. They struggled with it and its crashes (opening up the code window) for two years before going on strike. It's just mysterious to me how this could have happened. I did note he used some archaic (to me) techniques such as docmd.gotocontrol "ccc" rather then me.controlname.setfocus. So I speculate he once know Access development fairly well but moved on to other things for a decade or two. And, not knowing the whole story, he may have intended to go back and add error code and someone blew the whistle and stopped development.
 
I prefer to use me for all the reasons above + what I always do is use mixed case in object names e.g. txtDiscussions, then when I am coding I always enter me.txtdiscussions and let intellisense capitalise it for me. If I have a bad day and type me.textdiscussions or me.txtdiscussion I immediately know that I have got the object name wrong becuase it does not get capitalised.
 
I prefer to use me for all the reasons above + what I always do is use mixed case in object names e.g. txtDiscussions, then when I am coding I always enter me.txtdiscussions and let intellisense capitalise it for me. If I have a bad day and type me.textdiscussions or me.txtdiscussion I immediately know that I have got the object name wrong becuase it does not get capitalised.

Same here - that's why I was amazed a developer wouldn't use it. Again, probably traces to a developer long out of the MS Access development field as I recall a time when there was no intellisense.
 
I too am mystified when people I think should know better don't use "Me.". There is no downside and it gives you so much.
 

Users who are viewing this thread

Back
Top Bottom