Calculating in Forms

S

Sue

I'm trying to calculate form fields and am having a heck of a time. The form
fields I am trying to calculate are defined as number fields, fill in
enabled, calculate on exit. The thought is to have users fill out a form,
and have certain fields calculated. The syntax I'm trying to use to multiply
two fields (lets call them fieldone and fieldtwo) is as follows:
=SUM(fieldone*fieldtwo)
I've tried using a text form field and the field that's inserted through
Insert - Field. When I do the Insert-Field, I get a Syntax Error message.
When I use a text form field I don't get anything.
Any ideas anyone?
 
N

Ness

If you just want to multiply the fields use =fieldone*fieldtwo and have
calculation on exit on the last field.
 
N

Ness

I tried and it worked fine. Perhaps you could try writing a macro containing
ActiveDocument.Fields.Update
on the exit of the field(or right click update fields). There is nothing
wrong with the formula syntax =field1*field2 (the sum DOES however return an
error0
Remember to protect the document for forms to properly use the form text
fields

Hope this helps- got to go.
 
S

Sue

My stupid error! It's working. For some reason I have to tab two fields
down and THEN it calculates! I must have created them all willy-nilly!

Thanks Ness!
 
G

Greg

Sue,

"Lets call them fieldone and fieldtwo" ???

You have to call them what they are bookmarked. Open a blank new
document. Enter three formfields. By default the fields are
bookmarked text1, text2 and text3.

Double click the first field and format it a number type, calculate on
exit. Do the same with the second field. Double click the third field
and format it a calculation field. Enter the formula =text1*text2

Protect the form and everything should work. If you want to change the
terms in the formula then change the field bookmark names.
 
S

Sue

Thanks for the response Greg, but I figured it out. See my post above.
I was just using "fieldOne" and "Fieldtwo" as examples. I knew to use the
bookmark names.
 
S

Sue

No. I got it now. I set all fields to calculate on exit. I'm getting the
hang of this! Maybe you know my next hurtle...I want to make the form fields
longer than the 5 or so characters it displays so that I can underline them
and have them look the right size for the users as they are filling out the
form. Any ideas? When I look at the properties, I don't see anywhere to set
the length. I just see a maximum length.

Thanks Greg!
 

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