cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
darrenfloyd
Level: Powered On

Hidding a button until another button is selected

This is probably a simple one...?

 

I have three tabs/buttons on a screen, I've set a variable on each of these tabs - Set(varNumTab,1) - I want a Submit button to appear only when the third tab is selected. On the Submit button I set - Visible to varNumTab3 = 3 but the Submit button is showing on all the tabs. What's the best way to hide it on tabs one and two? 

3 REPLIES 3
Super User
Super User

Re: Hidding a button until another button is selected

@darrenfloyd 

Is it possible that you have made a typo here?  Your code in the Visible property of the button is currently

 

varNumTab3 = 3

 

But your code to set the tab number is this

 

Set(varNumTab,1) 

 

I think the variable name varNumTab and varNumTab3 need to have a consistent name for your tabs system to work.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

darrenfloyd
Level: Powered On

Re: Hidding a button until another button is selected

Hi @mdevaney 

 

Each tab has a variable set but I don't know if I need to do that, so Tab one, varNumTab,1 etc and I've set the Visible property on the button to varNumTab3 = 3 so that it would only show when the third tab is selected (varNumTab3 = 3)

 

I've noticed that the Submit tab doesn't show when the form is first fired up but stays on the form if I navigate back to Tab one. 

 

 

Super User
Super User

Re: Hidding a button until another button is selected

@darrenfloyd 

Now I understand that you have a separate variable for each tab (e.g. varTabNum1, varTabNum2, varTabNum3).

 

My suggestion would be to instead use a single-variable called varTabNum.  The varTabNum variable will hold the current tab selected as a number type like this.  

Set(varTabNum,3)

 

Using only a single-variable will ensure only one tab is selected at a time and it will cut down on the amount of coding required to toggle the tabs on and off.

 

//your current method to change tabs
Set(varTabNum1,0);
Set(varTabNum2,0);
Set(varTabNum3,3);

//my suggested method to change tabs
Set(varTabNum,3)

 

 

Then to make an object show when on tab 3 you would put this code in the Visible property

varTabNum=3

 

I believe if you use this "best practice" for creating a tabs system your other issues will go away 🙂

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (7,706)