A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Text form field loses formatting in Word 2010



 
 
Thread Tools Display Modes
  #1  
Old June 6th, 2010, 07:21 AM posted to microsoft.public.word.docmanagement
Michelle H.
external usenet poster
 
Posts: 2
Default Text form field loses formatting in Word 2010

I am trying to create a very simple form in Word 2010 (RTM, on Win7) which
has three fields: Qty, Unit Price, Ext. Price. Am using the legacy Text Form
field for each. The details on how I set up properties is below.
I restrict editing and then save it (as a DOTX, DOCX or even DOC-tried all),
and then open it to type values in my fields. Here's the problem: the fields
do not format the data as instructed. For example, I type in a unit price of
$1.50 and it saves the value of "1". That's it, just the number 1, and does
not format it as instructed (as currency). It displays the qty correctly,
but it strips out the currency formatting for Ext. Price as well. All
calculations are working (based on the values it saves in the form field, not
the values I've typed in), but the formatting is in error, and that makes the
calculation results wrong.

When I go back and view properties for each field, the number format is
blank - as if I never selected/changed it. If I select again, restrict,
save, and try again, still no formatting.
What might be causing this? I've tried in an old document and a brand new
one and the same thing happens. Information from this point forward is
supplemental about how I set properties for each field.

After I insert each field, I open the Properties and make appropriate changes:
Qty field: Number type, unlimited length, number format #,##0, calculate on
exit checked.
Unit Price field: Number type, unlimited length, number format
$#,##0.00;($#,##0.00), calculate on exit checked.
Ext price field: Calculation, unlimited length, number format
$#,##0.00;($#,##0.00), calculate on exit NOT checked.
Editing restrictions are set to allow only Filling in forms.

Thanks for any insights you might have.


  #2  
Old June 6th, 2010, 08:22 AM posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default Text form field loses formatting in Word 2010

That is an issue that I came across last week. A way around the problem is
to run the following macro on exit from any formfield to which you want to
apply the formatting:

Sub formatfldresult()
Dim ffname As String
ffname = Selection.Bookmarks(Selection.Bookmarks.Count).Nam e
With ActiveDocument.FormFields(ffname)
.Result = Format(.Result, "$#,###.00")
End With
End Sub


--
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

"Michelle H." Michelle wrote in message
...
I am trying to create a very simple form in Word 2010 (RTM, on Win7) which
has three fields: Qty, Unit Price, Ext. Price. Am using the legacy Text
Form
field for each. The details on how I set up properties is below.
I restrict editing and then save it (as a DOTX, DOCX or even DOC-tried
all),
and then open it to type values in my fields. Here's the problem: the
fields
do not format the data as instructed. For example, I type in a unit price
of
$1.50 and it saves the value of "1". That's it, just the number 1, and
does
not format it as instructed (as currency). It displays the qty correctly,
but it strips out the currency formatting for Ext. Price as well. All
calculations are working (based on the values it saves in the form field,
not
the values I've typed in), but the formatting is in error, and that makes
the
calculation results wrong.

When I go back and view properties for each field, the number format is
blank - as if I never selected/changed it. If I select again, restrict,
save, and try again, still no formatting.
What might be causing this? I've tried in an old document and a brand new
one and the same thing happens. Information from this point forward is
supplemental about how I set properties for each field.

After I insert each field, I open the Properties and make appropriate
changes:
Qty field: Number type, unlimited length, number format #,##0, calculate
on
exit checked.
Unit Price field: Number type, unlimited length, number format
$#,##0.00;($#,##0.00), calculate on exit checked.
Ext price field: Calculation, unlimited length, number format
$#,##0.00;($#,##0.00), calculate on exit NOT checked.
Editing restrictions are set to allow only Filling in forms.

Thanks for any insights you might have.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:06 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.