Tom,
<<...Me.Txt1 = Forms![Data Input Form]!mytx would not work...>>
My example did use ".", not "!".
The Bang operator ( ! ) usually refers to a control, field or object in a
collection, for example, an instance of a control in a form's Controls
collection.
The Dot operator ( . ) usually refers to an object's methods or properties,
for example, Forms!Form1!Control1.Enabled, or rst.MoveNext.
In this case, the Dot operator works (whereas the Bang operator does not)
because the variable mytx is not an object that belongs to a collection, so
it's treated the same way as properties and methods of the form.
Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyTitle/productCd-0764559036.html
Tom said:
Ok, Thanks.....
Actually my fom names have spaces in them such as Data Input Form, so I
had to wrap the form names in brackets, the
strange thing is that Me.Txt1 = Forms![Data Input Form]!mytx would not work, but
Me.Txt1 = Forms![Data Input Form].mytx does work. The only difference
is
the "." before the variable rather then a " ! " ?
Is there a rule of thumb on when to use the ! or the . ?
Thanks