galaxiom; said:
Never use Form_formname in any reference.
Always Forms!formname
may i know where or which book did you
get this idea.
'coz all the books i read about form Class
never said to "Never" use it.
the authors are MVPs.
Regardless of the credentials of the author, every claim must stand on its own merits and they would need to explain why the bang shouldn't be used. MVP or not, a statement not supported by a logical and rational argument carries no weight.
Right or wrong, unsubstantiated claims are sometimes uncritically accepted and repeated until they become the prevailing opinion. The difference between the bang and dot operators is probably the most prevalent case of this phenomenon in Access/VBA.
While always open to consider any counter arguments, I have little doubt that the bang is actually more correct than the dot in this context.
Firstly, from a practical sense. Access 2010 introduced Intellisense to the Query Designer. On the criteria row, a list of forms in the project will only be offered when Forms is followed by a bang, not a dot. That would certainly be an odd design decision by Microsoft if the bang were incorrect.
It can also be argued from basic principles.
The dot is used for early bound references to members of an object while the bang is a late bound reference to the default member and is ignored during compilation.
A form object as a member of the Forms Collection only makes sense in a Late Bound context since the Forms Collection is empty until run time. Hence the bang would be the appropriate operator.