PDA

View Full Version : Solved: make visible based on value



Emoncada
10-05-2009, 05:23 AM
I have two userforms. I have a ComboBox (CmbBoxDesktopQty) with values of 1-30 in userform1.

I have a cmdbutton that would hide userform1 and shows userform2. I would like for based on (CmbBoxDesktopQty) value to make certain things visible in userform2.

Example

If CmbBoxDesktopQty = 3 Then
Userform2.Lbl1.visible = true
Userform2.Txtbox1.visible = true
Userform2.Lbl2.visible = true
Userform2.Txtbox2.visible = true
Userform2.Lbl3.visible = true
Userform2.Txtbox3.visible = true

I think maybe using cases might work.
I set it up in the way that whatever the value is userform2 can match with value.
Example
Userform1.CmbBoxDesktopQty.value = 10
Then Userform2 Lbl1-10 & Txtbox1-10 would be visible.

Hope this is kind of clear and help would be great thanks.

Bob Phillips
10-05-2009, 05:55 AM
Certainly would



With Userform2

Select Case CmbBoxDesktopQty.Value

Case 3
.Lbl1.visible = True
.Txtbox1.visible = True
.Lbl2.visible = True
.Txtbox2.visible = True
.Lbl3.visible = True
.Txtbox3.visible = True
Case 10
.Lbl1.visible = True
.Lbl2.visible = True
.Lbl3.visible = True
'etc.

Emoncada
10-05-2009, 06:17 AM
Looks Good Thanks XLD.