M
Malik via AccessMonster.com
Hi.
Plz Tell Me that What Is Difference Btween Form.TextBox And Form!TextBox.
Thanks
Plz Tell Me that What Is Difference Btween Form.TextBox And Form!TextBox.
Thanks
Malik via AccessMonster.com said:Hi.
Plz Tell Me that What Is Difference Btween Form.TextBox And Form!TextBox.
Thanks
Stuart McCall said:They both refer to the same object, just getting it from different places.
When you use the dot syntax, you're referring to TextBox as a property of
the form, whereas using the bang syntax obtains TextBox from the form's
Controls collection.
Technically, the difference is that Form.TextBox is resolved at
compile-time whereas Form!TextBox is resolved at runtime (ie once the code
has been compiled and is executing).
I doubt you'll ever see a performance difference, so the choice is
yours...
Allen Browne said:And if you really want more detail than the practical summary Stuart
provided, you can read further here:
http://advisor.com/doc/05352
My personal preference is to use the dot when referring to controls,
precisely because misspellings are caught at compile time. I don't use the
dot to refer directly to field names in the form's recordset, because that
can fail. (Access seems to handle these objects of type AccessField
inconsistently.)