cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

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
Highlighted
Super User
Super User

Re: Hidding a button until another button is selected

@Anonymous 

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

 

Highlighted
Anonymous
Not applicable

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. 

 

 

Highlighted
Super User
Super User

Re: Hidding a button until another button is selected

@Anonymous 

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
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (12,746)