mardi 10 juillet 2018

VB Nesting with Else statement for the Main

Tried nesting multiple large Sub classes into a Main class with Else statement for the Main (if none of the conditions in the all Sub classes are met, Else statement is invoked ) however the syntax is not working ? (Probably nesting Hierarchy is not correct) Appreciate any Advice.Thank you

Private Sub CommandButton2_Click()
Call public Class  Main
End Sub


Public Class Main

Private Sub Sub_1()

If ComboBox1.Value = "ANYWHERE1" And ComboBox2.Value = "ANYWHERE1" Then
TextBox1.Value = "Go1"
End If

If ComboBox1.Value = "ANYWHERE2" And ComboBox2.Value = "ANYWHERE2" Then
TextBox1.Value = "GO2"
End If

If ComboBox1.Value = "ANYWHERE3" And ComboBox3.Value = "ANYWHERE1" Then
TextBox1.Value = "GO3"
End If

End Sub


Private Sub Sub_2()

If ComboBox1.Value = "ANYWHERE1" And ComboBox2.Value = "ANYWHERE1" Then
TextBox1.Value = "Go1"
End If

If ComboBox1.Value = "ANYWHERE2" And ComboBox2.Value = "ANYWHERE2" Then
TextBox1.Value = "GO2"
End If

If ComboBox1.Value = "ANYWHERE3" And ComboBox3.Value = "ANYWHERE1" Then
TextBox1.Value = "GO3"
End If

End Sub

Else
TextBox1.Value = "YES"

End Class

Aucun commentaire:

Enregistrer un commentaire