-
consider the following:
Code:
frmDrawDlg!txtAspectheight.Visible = false
now consider:
Code:
frmDrawDlg.txtAspectheight.Visible = False
Both of the above statements work, but...
Q. Why use an exclamation mark instead of a dot?
Answers on a postcard please to:
24 Crispin hasn't woken up yet Street
Springfield
90243
Thanks in advance guys.
-
Recordsets.
If a field name contains a space (or similar - not that u you would ever do this, right? ;)), it needs to be protected from big bad world by square brackets or quotes. You can't use a dot woth these
eg
rs![A Test] works
rs.[A test] doesn't.
The it seems you can use exclamations to point to objects, and dots to reference methods and some objects
(that last bit may be a bit spurious!)
-
Then...
What is the difference between:
rs("A Test") and rs![A Test]
-
Gaffer,
Thanks!, i've used the recordset stuff before, I had never seen objects or methods referenced by an exclamation, always a dot (wierd)
-
Early binding and late binding. Using the fullstop is late bound and therefor slower. That is as far as Recordsets are concerned.
I'm not sure about forms, although I do know that some other objects are slower if you use "." instead of "!"
Shrog
-
<?>
data1.recordset.myField = text1
or
data1!myfield = text1
the ! in this instance is a shortcut
you can omit the reference to the recordset
as the ! implies a recordset follows the control
-
I have no problem with the recordset syntax (I don't have a problem with any of it for that matter) I am interested as to why it is used (and for what specific reason (if any)) for referencing objects in forms, like textboxes e.t.c If it's early binding vs late binding then I can appreciate that, but is anybody really sure about this one:
Form.textbox.caption = "I am sure"
Vs
Form!textbox.caption = "Or am I?"
I don't know of anything in the IDispatch interface that qualifies dispID's in different ways, I reckon i might be barking up the wrong tree......