The use of Forms! means that you are referring to a form in the FORMS
collection. The name of the form comes after that.
So, if you have a form named frmTest and you are clicking a button on a form
named frmMain, the code to refer to control named txtName on that frmTest
form would be:
Forms!frmTest.txtName
To use it we would normally assign the value to it, or get the value, but
there are myriad things we could do with it.
If you are referring to a subform that is on another form, you would use
Forms!frmTest.YourSubformContainerNameHere.Form
The .Form there is telling Access we are talking about the form (subform)
which is housed in the subform container control (control on the main form
that houses the subform).
So, to refer to a control on the subform you would use
Forms!frmTest.YourSubformContainerNameHere.Form.txtMyControl
Now, that being said, you can also use this method to refer to the forms
collection:
Form("YourFormNameHere")
Which is essentially the same as saying Forms!YourFormNameHere
I hope that helps.
--
Bob Larson
Access World Forums Super Moderator
Utter Access VIP
Tutorials at
http://www.btabdevelopment.com
If my post was helpful to you, please rate the post.
__________________________________