Jump to content

Hiding and showing button in Form


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

Recommended Posts

Yeah, but having multiple layouts that mirror each other creates a lot of extra work in the long run - if you make a change to one layout you have to make sure you reflect that change in its mirror. Eddy's suggestion requires only one layout and is a pretty common and accepted practice for maing things either show or hide on a layout based on some change in a value.

Link to comment
Share on other sites

Yes John is right. Before I was shown this trick I used multiple layouts just to show/hide buttons. When the time came to do some serious upgrade work on the DB is was an absolute nightmare trying to keep all the layouts the same - if I changed 1 I had to change about 4! This method is a lot cleaner and a better effect than switching to another layout.

Ed

Link to comment
Share on other sites

Ed,

I understand how the IFstatement in the SET GLOBAL script changes the value from 1 to 0 and vice versa but I cannot figure out what you did to make button 2 magically appear.

It sure does look handy.

Would you mind a lending a little explication here for us un-erudites?

Jarvis

Link to comment
Share on other sites

Hi Jarvis,

Sorry I should have been a bit clearer in the original post.

OK Button2 is inside a poral, if you click just around the egde of Button 2, you will find the portal. This portal is based on a relationship. The relationship is between the global field and the constant field.

When the global field and the constant field match, the portal will show it's contents (the button). When the fields do not match the portal is hidden (you no longer see the button)

Just a quick note, I messed up a little in the demo file. Button 2 is set so that the pointer changes to a finger when you go over the button. You might want to stop this from happening (format -> button). This is because, even when the button is hidden, your mouse pointer will still change to a finger pointer when you go over the place where the button appears even when it is not showing.

I hope this is a bit clearer for you.

Anymore questions, just give us a shout.

Once you get used to using this method, it can be very useful.

Best regards

Ed.

PS, if you have a look for a date calculations example I posted in the samples forum, you will see an adaptation of this method, when a field contents is empty, nothing will show, but then when you enter some data into the field, other fields magically appear - this also can be useful in some databases.

Link to comment
Share on other sites

  • 2 months later...

This topic is 7281 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.