T
TonyB
Hi,
I'm not sure if I should be asking this question here for in the forms
newsgroup but I'm guessing this may require a vba solution.
On a subform which is displaying one more related records, I have some vba
to write a field in the record depending on both a checkbox in the main form
and a value on another field in the subform.As I add new records in the
subform or alter values directly in the subform on a particular record, the
vba recalculates the new value for this field depending on the main form
checkbox value and the value of the other field in this record.
This was straightforward as it done on an individual record, and only had to
refer to a single field in it's own record and the setting of the check box
in the form above.
What I'm trying to do is to recalculate these values in any records
displayed in the subform if the checkbox in the main form is altered.
Obviously I can use the afterupdate event on the check box to run some code,
but I'm stuck as to how to make each record displayed in the subform
recalculate this value for each record depending on the check box.
I need to go through each record currently displayed in the subform and
recalculate the relevent field depending both on the other field in the
selected record and value of the checkbox.
How do I find out how many records are shown in the sub form from the code
in the main form event, and then syntactically refer to the field in each
record in turn to recalculate the value for for each record ?
TIA
Tony
I'm not sure if I should be asking this question here for in the forms
newsgroup but I'm guessing this may require a vba solution.
On a subform which is displaying one more related records, I have some vba
to write a field in the record depending on both a checkbox in the main form
and a value on another field in the subform.As I add new records in the
subform or alter values directly in the subform on a particular record, the
vba recalculates the new value for this field depending on the main form
checkbox value and the value of the other field in this record.
This was straightforward as it done on an individual record, and only had to
refer to a single field in it's own record and the setting of the check box
in the form above.
What I'm trying to do is to recalculate these values in any records
displayed in the subform if the checkbox in the main form is altered.
Obviously I can use the afterupdate event on the check box to run some code,
but I'm stuck as to how to make each record displayed in the subform
recalculate this value for each record depending on the check box.
I need to go through each record currently displayed in the subform and
recalculate the relevent field depending both on the other field in the
selected record and value of the checkbox.
How do I find out how many records are shown in the sub form from the code
in the main form event, and then syntactically refer to the field in each
record in turn to recalculate the value for for each record ?
TIA
Tony