ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Multiform coding problem (https://www.excelbanter.com/excel-programming/438594-multiform-coding-problem.html)

Brad

Multiform coding problem
 
I believe that I'm close but can't seem to get it right.

What I want to do is to control the visibility of ComboBox's and Labels on
Multiforms. Am I close? cmbEDU is the name of the first ComboBox on the
Multiform. I'm not sure if I need to note that this code is not on the
Multiform itself.


Private Sub cmbProdSeries_Change()
cmbProduct.RowSource = ""
cmbProduct.Text = ""
Select Case cmbProdSeries.Text
Case Is = "Experience Life"
cmbProduct.RowSource = "inpELProducts"
lblCDate.Caption = "Contract Effective Date"
cmbClass.RowSource = "inpStatusLbD"
MultiPage1.Pages("Page1").Item(cmdEDU).Visible = False
' MultiPage1.Pages("Page1").Item(lblEDU).Visible = False
Case Is = "Life by Design"
cmbProduct.RowSource = "inpLbDproducts"
lblCDate.Caption = "Contract Application Date"
cmbClass.RowSource = "inpStatusLbD"
MultiPage1.Pages("Page1").Item(cmdEDU).Visible = True
' MultiPage1.Pages("Page1").Item(lblEDU).Visible = True

Case Is = "New Series"
cmbProduct.RowSource = "inpNEWproducts"
lblCDate.Caption = "Contract Application Date"
cmbClass.RowSource = "inpStatusLbD"
MultiPage1.Pages("Page1").Item(cmdEDU).Visible = True
' MultiPage1.Pages("Page1").Item(lblEDU).Visible = True
End Select

End Sub
--
Wag more, bark less

Brad

Multiform coding problem
 
Got it!!! Can this be simplified???

Private Sub cmbProdSeries_Change()
cmbProduct.RowSource = ""
cmbProduct.Text = ""
Select Case cmbProdSeries.Text
Case Is = "Experience Life"
cmbProduct.RowSource = "inpELProducts"
lblCDate.Caption = "Contract Effective Date"
cmbClass.RowSource = "inpStatusLbD"
MultiPage1.Pages("Page1").Item("cmbEDU").Visible = False
MultiPage1.Pages("Page1").Item("lblEDU").Visible = False
Case Is = "Life by Design"
cmbProduct.RowSource = "inpLbDproducts"
lblCDate.Caption = "Contract Application Date"
cmbClass.RowSource = "inpStatusLbD"
MultiPage1.Pages("Page1").Item("cmbEDU").Visible = True
MultiPage1.Pages("Page1").Item("lblEDU").Visible = True

Case Is = "New Series"
cmbProduct.RowSource = "inpNEWproducts"
lblCDate.Caption = "Contract Application Date"
cmbClass.RowSource = "inpStatusLbD"
MultiPage1.Pages("Page1").Item("cmbEDU").Visible = True
MultiPage1.Pages("Page1").Item("lblEDU").Visible = True
End Select

End Sub


"Brad" wrote:

I believe that I'm close but can't seem to get it right.

What I want to do is to control the visibility of ComboBox's and Labels on
Multiforms. Am I close? cmbEDU is the name of the first ComboBox on the
Multiform. I'm not sure if I need to note that this code is not on the
Multiform itself.


Private Sub cmbProdSeries_Change()
cmbProduct.RowSource = ""
cmbProduct.Text = ""
Select Case cmbProdSeries.Text
Case Is = "Experience Life"
cmbProduct.RowSource = "inpELProducts"
lblCDate.Caption = "Contract Effective Date"
cmbClass.RowSource = "inpStatusLbD"
MultiPage1.Pages("Page1").Item(cmdEDU).Visible = False
' MultiPage1.Pages("Page1").Item(lblEDU).Visible = False
Case Is = "Life by Design"
cmbProduct.RowSource = "inpLbDproducts"
lblCDate.Caption = "Contract Application Date"
cmbClass.RowSource = "inpStatusLbD"
MultiPage1.Pages("Page1").Item(cmdEDU).Visible = True
' MultiPage1.Pages("Page1").Item(lblEDU).Visible = True

Case Is = "New Series"
cmbProduct.RowSource = "inpNEWproducts"
lblCDate.Caption = "Contract Application Date"
cmbClass.RowSource = "inpStatusLbD"
MultiPage1.Pages("Page1").Item(cmdEDU).Visible = True
' MultiPage1.Pages("Page1").Item(lblEDU).Visible = True
End Select

End Sub
--
Wag more, bark less



All times are GMT +1. The time now is 01:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com