Calculate form fields...

J

jkitzy

I have a form with several tables and fields within the tables. I've added
buttons to expand/contract the table, enabling users to only see those rows
they'll use. This keeps clutter off the page and makes the form more
dynamic. I have no issues with this function; it's great!

Let's call them Rows 2 through 14

My problem arises when the user clicks the minus button. To prevent data
from being stored when it shouldn't, the fields in the deleted row are first
cleared, then hidden, then disabled. This prevents tabbers from tabbing
through hidden fields.

So far so good. The problem comes in row 15 - where my totals are stored.
Because the macro doesn't actually exit the fields when they're cleared, my
totals don't update.

Can't quite figure this out. The fields are set to calculate on exit, so
when adding rows, no problem. When the users enter an amount, it recalculates
fine. It's only when I'm deleting and clearing the results of the field that
I have a problem.

Any thoughts? Thanks.
 
D

Doug Robbins - Word MVP

Include the code in your macro to update the formfield containing the result
of the calculation

Something like

ActiveDocument.Bookmarks("bookmarknameofformfield").Range.Fields.Update

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

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

Top