Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pick data from a field in a subform and place it into a variable 1

Status
Not open for further replies.

Lreader

Technical User
Jul 27, 2000
13
CA
I have a form with a subform.
I need to add a control button in that form .
This button has to pick the data from one specific field in the subform and put it into a variable.

I can do this when the field is in the form and do something like this:
Dim x as var
x=[Form]![FormName]![MyField]

...but from the subform, I don't know how to code it.

Thanks for your answers!
 
Lreader

Exactly the same way.

Dim x as var
x=[Form]![FormName]![MyField]

Can be written as
x=Me.MyField
(Hint: Always avoid using spaces in field names -- makes it so much easier to code)

To access the subform, syntax is....
x=Me.YourSubForm.MyField

Richard


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top