Here's my $0.02 worth on this.
I tend to copy the notation style and naming conventions that I see being
used in the Help files.
That would be Me![text1] for a control on a form. I am of the belief that
this notation explicitly refers to a control itself rather than a field in
the form's recordset.
Here's an example:
I have a parts inventory app that uses a "Line" code, which is usually a
3-character abbreviation for a brand name, and is the name of both the field
name and the bound text-box control on many of my forms. Because the word
"Line" is one of those not-quite-a-reserved-word things ... so Access can
get confused and pissy if I don't wrap it in square brackets.
The "[Square Brackets]" format also allows for control names that may have
spaces in them. (Not that I am in the habit of doing that.)
Another benefit (to me anyway) is that I am so used to using this format
that I do it by habit, so control references in my code really "stand out".
Like you, I will often allow the supplied "." format from the code editor to
get the spelling right (lazy), but then I go back and change it to the "bang
and brackets" style before compiling.
--
--
HTH,
Don
=============================
E-Mail (if you must)
My*****@Telus.net
Disclaimer:
Professional PartsPerson
Amateur Database Programmer {:o)
I'm an Access97 user, so all posted code samples are also Access97- based
unless otherwise noted.
================================================== ========================
"robert.waters" <ro***********@gmail.comwrote in message
news:11**********************@n76g2000hsh.googlegr oups.com...
Is there an advantage to using the '!' notation to represent form/
control relationships? (eg. Me!text1 vs Me.text1)
I am currently using the '.' notation exclusively (for code completion
in the VB Editor), but much of the high-quality code that I've seen
(in Duane Hookom's Query-by-Form db, for example) uses the other.