Jump to content
Sign in to follow this  
RyRy

trying to either enter data into or disable other fields based on entry into one

Recommended Posts

I am VERY new to filemaker pro v11 [or any version for that matter]; I just began using it to manage data for a non-profit group.

I am trying to write a script [assuming that is the correct way to go about it] that will be based off of one data field. When "yes" is selected from the first data field's value list, i want four other data fields to either all read "N/A," which is also an option in the value list, to disappear, or something to that effect... however, I have yet to write any code and my own attempts continue to fail so far! I suppose a third option could be that the other four fields are already hidden and only appear when "no" is selected.

Any help would be MUCH appreciated!!!

ps. I'm also unsure as to when / how to run the script... i know that one can set them to run when the layout loads; is that the way to do it?

much thanks...

Share this post


Link to post
Share on other sites

Script:


If[FirstDataField = "yes"]

Set Field [field2; "N/A"]

Set Field [field3; "N/A"]

Set Field [field4; "N/A"]

Set Field [field5; "N/A"]

end if

Attach a script trigger set to OnObjectModify to FirstDataField, and use it to call the script.

To have the fields appear on a No answer:

You must have a field ID with an autoentered serial number.

Create a new field kAnswerNo (calculation, = "No" (or "no" depending on how your value list is set up).

Create a new TO of your table and relate it to the original table by

OrigTable::kAnswerNo = NewTO::FirstDataField

OrigTable::ID = NewTO::ID

Add a portal to NewTO on your layout, and populate it with NewTO::Field2, NewTO::Field3..., NewTO::Field5

Now the fields in the portal will only be displayed if FirstDataField contains "No".

  • Like 1

Share this post


Link to post
Share on other sites

Thank you SO MUCH! I was at such a loss but I just did all of that and it works perfectly.

Share this post


Link to post
Share on other sites

What do you want to have happen if the first field changes to NO at a later time?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.