form field calculation trouble

K

Keith G Hicks

I've been all over the forums and newsgroups on this and am making 0
progress. This seems like it should be pretty simple but it's giving me
loads of grief.

I have a Word 2003 dot file set for filling in forms. It has 2 form fields
for the user to fill in a quantity and a price. There needs to be a 3rd
field that will show the result. I've tried doing this using a macro and
I've tried it using a calculation in the 3rd field Nothing works. Also,
every time I set the bookmark name in one of them it randomly goes blank the
next time I open the dot file so I can editi it.

Yes, the first 2 fields are set to calculate on exit. Yes, the 3rd field is
not allowed to be filled in.

field 1 (form text): Type = Number, Max length = 5, number format =
#,##0.00, Bookmark = NumAdultTickets, Fill-in enabled = true, Calculate on
exit = true

field 2 (form text): Type = Number, Max length = 5, number format =
#,##0.00, Bookmark = CostPerAdultTickets, Fill-in enabled = true, Calculate
on exit = true

I created field 3 by using CTRL+F9: Then I right clicked it and chose "Edit
Field". I clicked the "formula" button and in the "Formula" box I typed
=NumAdultTickets*CostPerAdultTicket. I set the number format to #,##0.00.
After clicking "OK" I see this in my table cell:
{{=NumAdultTickets*CostPerAdultTicket \#"#,##0.00"}}

I set the dot file to protected for filling in forms and saved it. Then I
double clicked the dot file to create a new doc file from it. When I fill in
the first 2 fields nothing happens in the 3rd. It's just blank.

I'm an experienced VB, FoxPro, Access, Delphi, SQL programmer. It sucks
trying to get stuff like this to work. It's not logical. What am I doing
wrong?

Please don't refer me to Dian Chapman's series of articles. I've looked them
over and they seem to only cover initially creating the form and some fields
and then writing vba for it. VBA seems overkill for simple calculations
here. Everything I've read indicates that what I'm doing above should work.

Thanks for any help you can give,

Keith
 

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