Field Codes - If Field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I have several forms and I want to fill in certain boxes depending on
criteria I select from a dropdown list in a different box. I have looked at
the IF Field messages posted and they all seem to mention MAILMERGE. The
forms I am using are not MAILMERGE forms.
For example, in an Excel Form you would choose the box you want the answer
to be in and type =IF(B:3 = "Tea","two sugars"), If B:3 was populated with
the statement "tea" the "answer" box would self-populate with the answer "two
sugars" I wish to use the same type of formula in a Word Form but am unable
to use the same formula in the Field codes box. Can this actually be done?
If so, how?!?!
Thank you
 
Lets say you have a formfield dropdown that you have bookmarked DD1 (to
keep it simple)

The possible values are Tea, Coffee, Beer. When you set this field up
check "Calculate on exit"

Now postition your cursor where you want the self populating field.
Don't put a formfield here instead use a ganged field construction
like.
Note all { } pairs are entered with CTRL+F9.
{IF{DD1}="Tea""Two Sugars"}{IF{DD1}="Coffee""Black and bitter
please"}{IF{DD1}="Beer""Why yes, I will have two, Thankyou"}
 
Greg,

fantastic, thank you. I knew I was close, but didn't
realise how close. You have saved my sanity! One more on
the same line if I may, once the code in the self
populating field has been entered, how can I get back into
it to change or expand it?

Charlie
 
Charlie,

To change the display, you change the selection in the dropdown field. To
change what is displayed, then you would unprotect your document, right
click the field and select "toggle field code" make your changes and
retoggle the field an reprotect the document.
 
Greg,

Thank you very much, you have been most helpful and answered my questions
perfectly

regards

Charlie
 
Macropod,

thanks but I am still a bit confused. The two bookmarks I have are 'rate'
and 'mileage', and the result will be shown in a form field called 'total1'.

Can you please point me in the right direction on where to put the bookmark
names in the coding you very kindly wrote.

Thanks you

Charlie
 
Hi Charlie,

I'm not sure what it is you're trying to achieve. The outline you gave
suggests a formula field (not a formfield) coded something along the lines
of:
{IF{Dropdown1}= "Tea" "Two Sugars"}

But, since you mention 'rate' and 'mileage', which I assume are the bookmark
names attached to formfields/dropdowns, I suspect you actually have some
sort of formula in mind. If you simply want to multiply the mileage and rate
bookmarks (regardless of how they're filled in), you can use a formula field
(again, not a formfield) coded as:
{={Mileage}*{Rate}}
to which you might want to add a numeric picture switch:
{={Mileage}*{Rate} \# $,0.00}
to show a currency result.

Cheers
 
Macropod,

Thank you, it works perfectly well, I now understand what goes where and the
calculations work. I do have one small question though and then I will leave
you alone! Once I have the end columns to calculate the mileage x the rate
(I then have a number of columns to add up at the bottom of the form) how do
I do that? I know how to do this using bookmarks, but as I do not have the
option to specify Bookmarks using Formula Fields (or do I!!), I can't get
them to add up to a total.

I am really grateful for your assistance so far

Regards

Charlie
 
Macropod,

Thank you, that is good news, I will check this out and get back to you.
Thank you for your help so far

Charlie
 

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

Back
Top