Jump to content

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


This topic is 4233 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies

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...

Link to comment
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
Link to comment
Share on other sites

This topic is 4233 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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