Accessing a variable/field of main form from subfo

I need to get the value of a field of the table that is the Source Table of my main form, from the subform. Is this possible? If so, how can it be done? Pari somasundaram.

OnDeactivate// of the main form currform.subform.FORM.SetValue(somevalue); SetValue is a function on the subform; SetValue(string) valuePassedin := String Now the subform has that value and you can do what you like with it. Taylor McCartney Development Specialist CSB Systems tmccartney@csbsystems.com

In most cases you know which record is active in the main-form because the primary key of the main-record links them together. A simple get will do. But when they are linked through other fields or you want to retrieve a variable, the ‘Taylor-way’ is a nice one. Regards, Reijer.

quote:


Originally posted by tmccartney: OnDeactivate// of the main form currform.subform.FORM.SetValue(somevalue); SetValue is a function on the subform; SetValue(string) valuePassedin := String Now the subform has that value and you can do what you like with it. Taylor McCartney Development Specialist CSB Systems tmccartney@csbsystems.com


Thanks, Taylor. That worked! I added the code in the OnAfterGetRecord trigger of the main form because I need it to pass the field value to the subform if the user navidates from one record to the next of the main form. Pari Somasundaram.