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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top