IF field? and if so, how to set up it??

  • Thread starter Thread starter revolution21
  • Start date Start date
R

revolution21

Hi to everyone, this is my first post in this forum
Hope that someone can help me and that my question is not already
published on the board (if so, I'm sorry but i wasn't able to find it
:P)

My problem is:

I want to do a form, in which I need to use a dropdown menu at the
beginning that allows me to select between "Mr." and "Miss". I would
like that in the rest of the text, evreytime i need to use a pronoun
like his or her, automatically every pronoun will be changed according
to the selection in the dropdown menu, E.g. if I choose "Miss" in the
dropdown every pronoun have to switch to "her"... if I choose "Mr.",
the same spots need to be changed in "his"... Is there any solution to
this??
I don't know if the question is clear..sorry for bad english!
Thanks in advance
 
Hi revolution21,

All you need to do with your dropdown field, note it's bookmark name and set its properties to 'calculate on exit. Then, wherever
you want the results of the dropdown selection replicated, insert a cross-reference (via Insert|Cross Reference) pointing to the
dropdown's bookmark. When you're done, protect the document for forms.

Cheers
 
But he doesn't want the results of the dropdown. He wants his/her, him/her,
etc., based on whether the choice is Mr., Miss, Ms, Mrs., etc. This is
probably a better job for a UserForm, and it's something that can be done by
Bill Coan's DataPrompter (http://www.wordsite.com/products/dpdas.htm).

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

macropod said:
Hi revolution21,

All you need to do with your dropdown field, note it's bookmark name and
set its properties to 'calculate on exit. Then, wherever you want the
results of the dropdown selection replicated, insert a cross-reference
(via Insert|Cross Reference) pointing to the dropdown's bookmark. When
you're done, protect the document for forms.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

revolution21 said:
Hi to everyone, this is my first post in this forum
Hope that someone can help me and that my question is not already
published on the board (if so, I'm sorry but i wasn't able to find it
:P)

My problem is:

I want to do a form, in which I need to use a dropdown menu at the
beginning that allows me to select between "Mr." and "Miss". I would
like that in the rest of the text, evreytime i need to use a pronoun
like his or her, automatically every pronoun will be changed according
to the selection in the dropdown menu, E.g. if I choose "Miss" in the
dropdown every pronoun have to switch to "her"... if I choose "Mr.",
the same spots need to be changed in "his"... Is there any solution to
this??
I don't know if the question is clear..sorry for bad english!
Thanks in advance
 
Suzanne S. Barnhill said:
But he doesn't want the results of the dropdown. He wants his/her, him/her,
etc., based on whether the choice is Mr., Miss, Ms, Mrs., etc.

Missed that. Still, easily enough done with an IF test at each location:
{IF{Dropdown1}= "*s" her his}
or
{IF{Dropdown1}= "*s" her him}
or
{IF{Dropdown1}= "*s" she he}
depending on the context.

Cheers
 
macropod;2730901 said:
Missed that. Still, easily enough done with an IF test at each
location:
{IF{Dropdown1}= "*s" her his}
etc...

Thanks for your answers.. but it seems not to work :-/

I used an IF field as you wrote { IF { Gender } = "Miss" her his },
named the dropdown menu "Gender" and checked the "calculate" box... but
the IF field is always on "his", even if i change the choice in dropdown
and then refresh.
Do you know any another possible solution or am I missing something?
 
Hi revolution21,

The test is case-sensitive, so make sure that the capitalisation in you dropdown and IF test match. Make sure too that there are no
unnecessary spaces in the choices assigned in the dropdown or in the IF test (eg "Miss ").

Also, the field coding I posted obviates the need to know whether you're using Mr, Master, Mrs, Miss or Ms. It does this by using
the * wildcard to represent all except the last character. If (as convention says you should) the abbreviated forms are followed by
a period (ie Mr., Master, Mrs., Miss or Ms.), you could change the IF tests to:
{IF{Gender}= "*s?" her his}
or
{IF{Gender}= "*s?" her him}
or
{IF{Gender}= "*s?" she he}
depending on the context. This adds the ? wildcard to force the IF test to examine the penultimate character.

Cheers
 
In addition to Macropod's comments, did you use CTRL+F9 for the brackets
around Gender? Without them it will always show 'his'.
Also did you tab out of the Gender field?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Graham said:
In addition to Macropod's comments, did you use CTRL+F9 for the brackets

around Gender? Without them it will always show 'his'.

Thank you so much to macropod and graham! now it works! I think
brackets were wrong in my first attempt.
Thank you again mates.
 
Hi again

I've another difficult (for me :P) task that maybe requires an IF
field.
I've to prepare a form for a sort of income. It works this way:

gross amount = X ("Lordo")
tax 20% = Lordo/5 ("Imponibile")
net amount = Lordo - Imponibile

in this form, inserting the gross amount it's possible to know the net
amount.
I assigned a bookmark to the gross amount text field ("Lordo"), then
another one to the function to know the amount of the tax
("Imponibile"), then the final function subtracting the tax amount from
the gross amount.
The problem is: in Italy you have two different rates for taxes: one is
20% (like in the example shown), another is 30%. I would like to allow a
choice between the two tax amounts, and then I would like that the form
will be able to calculate depending on the choice of the tax amount.
Is there a way to do that?
By the way, to calculate the 30% tax amount i used this forumla:
(Lordo x 3)/10.

thanks in advance for you help!
 
Insert three textbox formfields into your document and a dropdown formfield
to which you add (via its properties dialog) the entries 20% and 30% and
have a macro containing the following code run on exit from the dropdown
formfield

Dim rate As Long
With ActiveDocument
If .FormFields("Dropdown1").DropDown.Value = 1 Then
rate = 20
Else
rate = 30
End If
If IsNumeric(.FormFields("Text1").Result) Then
.FormFields("Text2").Result = .FormFields("Text1").Result * rate /
100
.FormFields("Text3").Result = .FormFields("Text1").Result * (1 -
rate / 100)
Else
MsgBox "You must enter a numeric value"
End If
End With

The macro assumes that the name of the bookmark assigned to the formfield
into which the gross amount will be entered is Text1 and the amount of the
tax will be shown in the formfield Text2 and the net amount after tax will
be shown in Text3

--
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
 
If I understand correctly, yoiu have a form field "Lordo" which contains a
gross amount and a form field "Imponibile" which contains 20% or 30%? In
which case a pair of formula fields will work

{ ={ Lordo } * { Imponibile } }

and for the net amount

{ ={ Lordo } - ({ Lordo } * { Imponibile }) }

It would probably be sensible to use a dropdown formfield for the tax amount
containing 20% and 30% as values.


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Back
Top