Newbies ptatch Posted April 1, 2006 Newbies Share Posted April 1, 2006 How can i turn on (and off) a field in a calculation by using a button? I want to be able to add a field when applicable, and turn it off when not needed. Can someone help me find a solution to this? Thanks, Peter Link to comment Share on other sites More sharing options...
Fenton Posted April 1, 2006 Share Posted April 1, 2006 First, I deleted the duplicate post in the Articles forum, as that was the wrong place, and this is the right one. Please don't post the same thing in 2 different places. It creates confusion and makes a continuous discussion difficult. Most of use the "Recent Posts" search, so we'll see both posts. As to your question, the technique you're looking for is often called the "visibility" trick, from the example file of the same name by John Mark Osborne. http://www.filemakerpros.com/Visible.zip Do a search on Resources at the above site for other variations. He explains it well. The basic technique is based on a self-relationship, which only evaluates true under certain circumstances. The field, or object, you want to hide or show are inside a portal based on this self-relationship. You can also put other layout objects besides fields inside it. Objects inside only appear when the portal's relationship is valid. Buttons running scripts which are not visible will not respond to a click on their former location (though the "hand" will still show; best to turn it off for such buttons). Link to comment Share on other sites More sharing options...
Raybaudi Posted April 1, 2006 Share Posted April 1, 2006 Hi this is only an idea... AddFieldToCalculation.zip Link to comment Share on other sites More sharing options...
kgasman Posted April 2, 2006 Share Posted April 2, 2006 I downloaded the file and I am confused on how it works. I have a relational database. One table is a client database and the other is related client billing records. I show the billing records in a portal on the client database (there are many billing records per client). In the portal is Dateofbill, typeofbilling, amount, and datebillsent. if the typeofbilling is a payment I wanted to make it so the datebillsent field wouldn't show. I suspect the Visibility trick is the way to go, but I just don't seem to understand it Link to comment Share on other sites More sharing options...
Oldfogey Posted April 3, 2006 Share Posted April 3, 2006 (edited) The visibility trick won't work in a portal because it uses a portal and you can't have a portal in a portal. However, a word of advice, really study it until you can understand it; it is worth its weight in gold. A calculation is the way to go. Daniele's idea is fine but a simpler way is to set your button to Set Field(ShowField; Case(Payment; ""; DateBillSent)) Edited April 3, 2006 by Guest Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6740 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 accountSign in
Already have an account? Sign in here.
Sign In Now