-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Bang (!) and dot (.) - basically the same. The exclamation point (bang)
means refer to the collection item. Since Me refers to the form, and
the form's default collection is Controls then Me!TxtBox refers to the
control "TxtBox" in the form's Controls collection.
The period (dot) means refer to the property. A control can also be a
property of the form, so Me.TxtBox refers to the control/property
"txtBox" and also any Field named "txtBox" in the form's Recordsource.
The ampersand (&) is purely a string concatenation operator. The plus
sign (+) is also a concatenation operator that sets the string to NULL
if NULL is the last value. E.g. (debug window):
? null & "this one" + null + " that one"
Null
? null & "this one" & null & " that one"
this one that one
Loading & Opening a form: Opening a form can be cancelled. Loading
can't cancel the opening of the form.
Unload & Close a form: Unload can be cancelled. Closing can't.
The order of events is:
Open: Open -> Load -> ...
Close: Unload -> Deactivate -> Close
--
MGFoster:::mgf0 0 <at> earthlink <decimal-point> net
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBQgrwxIechKq OuFEgEQKBNwCfen AA416mTzhOck3MU R1O+AWkBEQAnRgL
g9AVXzhKnM09otw UeRoUqCYa
=amVt
-----END PGP SIGNATURE-----
MS wrote:
Just a general question here re VBA.
Can anyone explain the differences between "!" and "." when refering to a control?
eg Me!TxtBox and Me.TxtBox.
What is difference between "+" and "&" when working with strings.
eg MyStr = "I have " & MyNumber & " apples." and MyStr = "I have " + MyNumber + " apples."
Also, what are the differences between Loading a form and Opening a form, Similarly with Unload and Close.
From my observations, all the above pairs achieve the same things - I find I can interchange them without noticing any differences. Are there subtle differences, or are they basically the same?
Cheers!