4 Replies Latest reply on Apr 12, 2010 8:54 AM by idwhite

Newbie: Replace text answer with number in second field?

Title

Newbie: Replace text answer with number in second field?

Post

Hello, I am new to FM11 using the trial...

I have two fields.  I need the second field to automatically show a number based upon the text entered into field 1.

ie...

Field One: "A"    Field Two: automatically enters: "123"  or if...

Field One:  "B"    Field Two: automatically enters: "456"

FieldOne is currently TEXT with POP-UP MENU from LIST with my predetermined values.

FieldTWO is currently CALCULATION... Is this correct? I tried doing a calculation such as If (fieldone = "A"; "123") but it only works if I do it the one time. If I try showing that plus other answers= other numbers, none of it works.

I would appreciate any help with this! Thanks so much!

• 1. Re: Newbie: Replace text answer with number in second field?

Use Case() instead of If() when you don't want to restrict your options ... Case() allows multiple tests whereas If() only allows one.  And yes, fieldtwo can be a calculation if User won't need option to overwrite the data.  Try something like:

Case (
FieldOne = "A" ; 123 ;
FieldOne = "B" ; 456 ;
789 )

Look in FM Help for more detailed explanation. :smileyhappy:

• 2. Re: Newbie: Replace text answer with number in second field?

Howdy idwhite,

I don't know enough about what you're trying to do to confirm that a calc is the right way, but if it is, try:

Case(fieldone = "A"; "123";

fieldone = "B"; "456";

fieldone = "C"; "789";

fieldone = "D"; "159";

"" )  This last is the default value for fieldone if none of the above conditions are true

Edit: LaRetta types faster than I !

• 3. Re: Newbie: Replace text answer with number in second field?

THANK YOU!!!

I kept trying to do: CASE (FieldOne = "A") or CASE... etc...

I didn't think of keeping it in the same case and I appreciate your help. Its working great now. :)

• 4. Re: Newbie: Replace text answer with number in second field?

Thank you as well Ninja!