For Each Record in a Subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to run a calcuation based on information in a subform and I would
like to use the For .. Each .. Next syntax. My question is: how do I address
the records in a subform using the For Each command?
 
SDeam said:
I am trying to run a calcuation based on information in a subform and
I would like to use the For .. Each .. Next syntax. My question is:
how do I address the records in a subform using the For Each command?

You'd have to loop through records in the subform's recordsetclone,
using the object's navigation methods to move from record to record.
However, are you sure that the calculation you have in mind can't be
calculated via one of the SQL aggregate functions, which could be used
as the controlsource expression for a control in the subform's form
header or footer?
 
thanks for the response -- I am pretty sure that I can't use an SQL function
-- I will check it out though.
 
Back
Top