Hi, please could someone tell me what is wrong here?
I will try my best to explain...
I have a form with 2 combo boxes and a few text boxes. The operator selects values from the combo boxes which in turn automatically populate the text boxes.. this all works.
What I want to do when the operator selects a certain value in cboProgClass, a value in cboCylType is automatically selected, dissables that combo box and hides one of the txt boxes. There are 10 different values in cboProgClass but only 4 of them are effected this way.
The problem is, all four values in cboProgClass change the values in cboCylType as I want but only only last of the four dissables the combo box and hides the text box, plus when the fourth one hides the text box and dissables the combo, changing the values to something other than these four does not bring them back again.. The code is below, unfortunately I am not a VBA programmer.
Private Sub cboProgClass_AfterUpdate()
If cboProgClass = "J" Then
Me.cboCylType.Value = "CLP"
Me.txtCust1.Visible = False
Me.cboCylType.Enabled = False
Else
Me.txtCust1.Visible = True
Me.cboCylType.Enabled = True
End If
If cboProgClass = "K" Then
Me.cboCylType.Value = "DCLP"
Me.cboCylType.Enabled = False
Me.txtCust1.Visible = False
Else
Me.txtCust1.Visible = True
Me.cboCylType.Enabled = True
End If
If cboProgClass = "M" Then
Me.cboCylType.Value = "LFT"
Me.cboCylType.Enabled = False
Me.txtCust1.Visible = False
Me.cboCylType.Enabled = True
Else
Me.txtCust1.Visible = True
Me.cboCylType.Enabled = True
End If
If cboProgClass = "N" Then
Me.cboCylType.Value = "LWR"
Me.cboCylType.Enabled = False
Me.txtCust1.Visible = False
Else
Me.txtCust1.Visible = True
Me.cboCylType.Enabled = True
End If
End Sub