Check all rows in continuous form?

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

Guest

I have a continuous form that contains several rows. One column is a
percentage value. I must ensure that the percentages for each row adds up to
exactly 100. I guess I only need do this upon exit from the form. Is there an
easy way to do it rather than open a new recordset? Recordset clone maybe?
 
I have a continuous form that contains several rows. One column is a
percentage value. I must ensure that the percentages for each row adds up to
exactly 100. I guess I only need do this upon exit from the form. Is there an
easy way to do it rather than open a new recordset? Recordset clone maybe?

Try showing the form's footer and put a textbox control with the
formula "=Sum([<field with the percentage>])" where you replace the
part between "<>" with the real name of the field. You can make the
textbox hidden after you are sure it works. In your code you can just
use the value of that control instead of looping over a recordset, for
example.

If you want to keep the form open and show an error message when the
percentages don't add up, use the form's OnUnload event procedure
which can be cancelled in code.
 

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