Generic way to refer to subform control in subform criteria (1 Viewer)

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 22:12
Joined
Jul 9, 2003
Messages
16,282
Everyone should ignore the explanation of dots and bang in that article. It is one of many contributions of misinformation adding to the confusion about the differences.

The bang is a Late Bound reference to the Default Member of an object. In the case of a form that is first to its Controls Collection then to its Recordset.

The dot is an Early Bound Reference to a Member of an object. The controls, properties and recordset are all members which is why they work with the dot.

In the case of Forms collection, the items in the collection are only loaded during runtime so the bang is technically more appropriate thought the dot works.

Otherwise it is generally better to use the Early Bound reference because any errors will be detected during the Compile instead of waiting to raise errors at runtime.

Thanks for the heads up on the Bang Dot Issue Greg. As I mentioned, I've never been sure about it, seeing all sorts of different things used and all sorts of different things worked! I'm still not 100% clear on how it affects the way I code, but I did find this site:-

http://bytecomb.com/the-bang-exclamation-operator-in-vba/

which does go into it in depth. I might have a browse and see if I can come up with a simple mnemonic to help me remember in the future! If I do I will post it...
 

Users who are viewing this thread

Top Bottom