Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Lenny Lenny is offline
external usenet poster
 
Posts: 74
Default Toggle form field between U.S. dollars and Euros

I have a finance form that my user would like to be able to show the entry as
either U.S. dollars or European Euros. Normally, the field would be set to
dollars and the format to reflect $x,xx.00. The Euro is formatted
differently. Can I use a check box or other device to affect the formatting
of the field?

Best regards... Lenny
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Toggle form field between U.S. dollars and Euros

Lenny wrote:
I have a finance form that my user would like to be able to show the
entry as either U.S. dollars or European Euros. Normally, the field
would be set to dollars and the format to reflect $x,xx.00. The Euro
is formatted differently. Can I use a check box or other device to
affect the formatting of the field?

Best regards... Lenny


One way you can do this is with a checkbox field and a macro run on exit
from that checkbox. The checkbox must be after the numeric input field(s).
The field that will represent the number must be formatted with a unicode
font that has the Euro symbol. In the example macro, the numeric field is
Text1 and the Checkbox field is Check1. The macro reads the numeric entry in
Text1 (***which should be a regular text field***) and adds the Dollar or
Euro sign.

If there are calculations involved with the content of the form field(s),
they will have to be performed in the macro and the result field(s) updated
accordingly, as a text field with a leading text character will not work in
a calculation. The basic code example is:

Sub CashFormat()
Dim sValue As String
sValue = ActiveDocument.FormFields("Text1").Result
If InStr(1, sValue, "$") Then
sValue = replace(sValue, "$", "")
End If
If InStr(1, sValue, "?") Then
sValue = replace(sValue, "?", "")
End If

If ActiveDocument.FormFields("Check1").CheckBox.Value = True Then
ActiveDocument.FormFields("Text1").Result = "$" & sValue
Else
ActiveDocument.FormFields("Text1").Result = "?" & sValue
End If
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Make 1 Million Dollars $$ George New Users 0 August 14th 05 10:19 AM
Make 1 Million Dollars $$$ John New Users 0 August 13th 05 06:35 PM
Can i make the euros sign hoe to make euros sign Microsoft Word Help 1 May 31st 05 01:16 PM
How do I set default on Toggle Field Codes? BoulderRon Microsoft Word Help 1 March 7th 05 04:25 PM
Toggle field codes. Frank Martin New Users 2 February 17th 05 03:11 AM


All times are GMT +1. The time now is 01:47 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"