Solved Why sometimes "." and sometimes "!"?

mafhobb

Registered User.
Local time
Today, 17:13
Joined
Feb 28, 2006
Messages
1,249
I have noticed that sometimes is certain parts of the VBA code, a "." is used and others a "!".

Is there any difference between these two? Is there a rule about their use?

Example:

Me.PropertyName.SetFocus
vs
Me!PropertyName.SetFocus

or

Forms!frmPropertyHistory![Cleanings Done].Form.Requery

Thanks
mafhobb
 
Wow! I though that I was asking a newbie/dumb question, but I see that there is extended debate.

Thanks bob fitz
 
In reality it's just the syntax of a language. The compiler knows what you mean based on the appropriate syntax, and it can't compile correctly if the syntax is incorrect.

It might confuse us, but it doesn't confuse the compiler.
 
I use whatever gives me intellisense (as a general rule, probably with exceptions), thus, I go for the dot whenever I can.
 

Users who are viewing this thread

Back
Top Bottom