According to Access2000 Developer's Handbook (pg. 441):
-------------------------------------------
Just remember these rules:
-Dots (".") can only be used to preface properties or methods, not objects
within collections. Access makes a special case for controls on forms (and
reports), so you can use a dot to preface these objects. This can make your
code run a bit faster, if it references these objects
-Bang ("!") turns into parentheses/quotes around an object internally, so
there's little reason to use it. In any case, you use bang or
parentheses/quotes to separate an object from the collection containing that
object.
---------------------------------------------
But Bob's explanation is far more elegant and easier to remember - thanks,
Bob!
BTW, I, too have always been amazed (or amused?) at how often Microsoft
violates its own rules. You read the "theoretical" syntax rules, try and
carefully follow them, then go to the help menu for an example and it's
different - yet sadly works just as well or better!
Guess that's why they pay Access programmers the BIG bucks...
Mike Metzger
"Andante.in.Blue" <05********@sneakemail.com> wrote in message
news:bc**************************@posting.google.c om...
Just out of curiosity, does anyone know the programmatic significance
of this? What goes on behind the scenes?
Bob Quintal <bq******@generation.net> wrote in message
news:<3a******************************@news.terane ws.com>...
"deko" <dj****@hotmail.com> wrote in
news:Ou********************@newssvr21.news.prodigy .com:
all this dot and bang syntax is confusing. if anyone can
bring clarity to this subject I would really appreciate it.
Microsoft suggested syntax is to use a dot when the word following
it is an Access word and use a bang if it's a programmer defined
word. But Wizard generated code often violates the recommendation.
me.visible
me!txtBox0
me!textBox0.visible
Forms!myForm!mySubform.form!txtBox0.visible
The only place I've had trouble when using the dot is with
set rst0 = x
rst0!fieldname works, rst0.fieldname sometimes gives an error.
Bob Q.