dbTalk Databases Forums  

Help with simple IF statement?

comp.databases.filemaker comp.databases.filemaker


Discuss Help with simple IF statement? in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
cat
 
Posts: n/a

Default Help with simple IF statement? - 11-02-2006 , 02:42 PM






I'm new to Filemaker,

I have a Contact1 field that holds a buisiness name. Next to that I
have a radio button that I want the user to select if Contact1 should
also be used as the shipping contact - thus hopefully auto-populating
the ShippingContact field. This way the user doesn't have to repeat
data entry.


Contact1__________ o Use as shipping contact

Shipping Contact___________


I think that I should:

Make ShippingContact a calculated field, so that it says something
like: If Contact1 is selected, then populate ShippingContact with
Contact1.

I just can't find an example and thus can't figure out how to write the
script. Any help is very much appreciated.

Thanks.


Reply With Quote
  #2  
Old   
Matt Wills
 
Posts: n/a

Default Re: Help with simple IF statement? - 11-02-2006 , 03:43 PM






A calculation is as simple stating what you want:

If a flag indicating you want Contact1 to be the ShippingContact, then
make it so.

ShippingContact = If ( test ; result1; result2)

which translates to

ShippingContact = If ( test ; result if test is true; result if test is
false)

Let's say the radio button is a field named UseContact1, and that the
value would be "Y"

Your formula for ShippingContact would be

ShippingContact = If ( UseContact1 = "Y" ; ShippingContact ; "" )

The problem being that if ShippingContact is a calc dependent on the
value of UseContact1, you wouldn't be able to populate it if you DON'T
want ShippingContact to be Contact1.

You need to leave ShippingContact as an editable Text field.

I would do a script which simply sets ShippingContact to the value of
Contact1 when the button is clicked. That way, you can put whatever info
you want in ShippingContact, still being able to use the button as
appropriate.

Just one step:

Set Field [ ShippingContact ; Contact1 ]

Matt

In article <1162500172.301696.172750 (AT) h54g2000cwb (DOT) googlegroups.com>,
"cat" <cathytyner (AT) gmail (DOT) com> wrote:

Quote:
I'm new to Filemaker,

I have a Contact1 field that holds a buisiness name. Next to that I
have a radio button that I want the user to select if Contact1 should
also be used as the shipping contact - thus hopefully auto-populating
the ShippingContact field. This way the user doesn't have to repeat
data entry.


Contact1__________ o Use as shipping contact

Shipping Contact___________


I think that I should:

Make ShippingContact a calculated field, so that it says something
like: If Contact1 is selected, then populate ShippingContact with
Contact1.

I just can't find an example and thus can't figure out how to write the
script. Any help is very much appreciated.

Thanks.

Reply With Quote
  #3  
Old   
cat
 
Posts: n/a

Default Re: Help with simple IF statement? - 11-02-2006 , 04:01 PM



Awesome, thanks so much Matt! Set field works.

Matt Wills wrote:
Quote:
A calculation is as simple stating what you want:

If a flag indicating you want Contact1 to be the ShippingContact, then
make it so.

ShippingContact = If ( test ; result1; result2)

which translates to

ShippingContact = If ( test ; result if test is true; result if test is
false)

Let's say the radio button is a field named UseContact1, and that the
value would be "Y"

Your formula for ShippingContact would be

ShippingContact = If ( UseContact1 = "Y" ; ShippingContact ; "" )

The problem being that if ShippingContact is a calc dependent on the
value of UseContact1, you wouldn't be able to populate it if you DON'T
want ShippingContact to be Contact1.

You need to leave ShippingContact as an editable Text field.

I would do a script which simply sets ShippingContact to the value of
Contact1 when the button is clicked. That way, you can put whatever info
you want in ShippingContact, still being able to use the button as
appropriate.

Just one step:

Set Field [ ShippingContact ; Contact1 ]

Matt

In article <1162500172.301696.172750 (AT) h54g2000cwb (DOT) googlegroups.com>,
"cat" <cathytyner (AT) gmail (DOT) com> wrote:

I'm new to Filemaker,

I have a Contact1 field that holds a buisiness name. Next to that I
have a radio button that I want the user to select if Contact1 should
also be used as the shipping contact - thus hopefully auto-populating
the ShippingContact field. This way the user doesn't have to repeat
data entry.


Contact1__________ o Use as shipping contact

Shipping Contact___________


I think that I should:

Make ShippingContact a calculated field, so that it says something
like: If Contact1 is selected, then populate ShippingContact with
Contact1.

I just can't find an example and thus can't figure out how to write the
script. Any help is very much appreciated.

Thanks.


Reply With Quote
Reply




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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.