kimberly090
Board Regular
- Joined
- May 22, 2014
- Messages
- 99
Hi,
I my userform look like this:
I have few criteria which to meet.
1. Different customer will have different process and specification
2. If the ID#(textbox1) is empty, the process and the specification will change as well.
3. Different customer will use different G-chip to carry out their progress.
As below will be my code:
When I try to run the code, the specification will not change. It will stay with a same number.
I have no idea, how that could happen when I have set all function one by one.
Customer: ComboBox1
ID#: TextBox1
G-chip:ComboBox3
Plating Type:ComboBox2
Lower Range:TextBox2
I my userform look like this:
I have few criteria which to meet.
1. Different customer will have different process and specification
2. If the ID#(textbox1) is empty, the process and the specification will change as well.
3. Different customer will use different G-chip to carry out their progress.
As below will be my code:
Code:
Private Sub Userform_initialize()ComboBox1.List = Array("Apple", "Banana", "Watermelon")
'ComboBox2.List = Array("Ni", "NiNi", "Au", "AuAu", "Pd", "PdPd")
'ComboBox3.List = Array("Aluminium", "Copper")
End Sub
Sub CustWithPTAlu()
Select Case ComboBox1
Case "Apple"
ComboBox2.List = Array("Ni", "NiNi")
Case "Banana"
ComboBox2.List = Array("Au", "AuAu")
Case "Watermelon"
ComboBox2.List = Array("Pd", "PdPd")
End Select
End Sub
Sub CustWithPTAluArray()
Call CustWithPTAlu
If ComboBox1.Text = "Apple" Then
TextBox2.Value = IIf(ComboBox2.Value = "Ni", "10S", "20S")
Else
If ComboBox1.Text = "Banana" Then
TextBox2.Value = IIf(ComboBox2.Value = "Au", "30S", "40S")
Else
TextBox2.Value = IIf(ComboBox2.Value = "Pd", "50S", "60S")
End If
End If
End Sub
Sub CuAl()
Select Case ComboBox1
Case "Apple"
ComboBox3.List = Array("Cu", "Al")
Case "Banana"
ComboBox3.List = Array("Cu")
Case "Watermelon"
ComboBox3.List = Array("Al")
End Select
End Sub
Sub CustXPT()
ComboBox2.List = Array("Ni", "NiAu", "NiPd", "NiPdAu")
End Sub
Sub CustXPTArray()
Call CustXPT
Select Case ComboBox2
Case "Ni"
TextBox2.Value = "70S"
Case "NiAu"
TextBox2.Value = "80S"
Case "NiPd"
TextBox2.Value = "90S"
Case "NiPdAu"
TextBox2.Value = "100S"
End Select
End Sub
Private Sub TextBox1_Change()
Call CuAl
If TextBox1.Value = "N/A" Then
Call CustXPTArray
Else
Call CustWithPTAluArray
End If
End Sub
When I try to run the code, the specification will not change. It will stay with a same number.
I have no idea, how that could happen when I have set all function one by one.
Customer: ComboBox1
ID#: TextBox1
G-chip:ComboBox3
Plating Type:ComboBox2
Lower Range:TextBox2