Hi
I have a cbox that has for numbers 601,602,603,604 and on the exit event a textbox will display the text that matches the number with a Vlookup formula.
That all works fine...
Now i have added another textbox which is not visble and should only be visible = true if the code in the cbox is 601.
Below is the code i have however even if i select 601 the txtbox does not become visible. there must be a problem with my wording?
Private Sub cBDcode_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Me.cBDcode = "" Then
Exit Sub
Else
If Me.cBDcode.ListIndex = -1 Then 'Check if the value is matching the criteria
MsgBox "Incorrect Breakdown Code!" & vbCrLf & "Please Select from the Dropdown list?" _
, vbOKOnly + vbExclamation, "Breakdown Code Error!!"
Me.cBDcode.Text = vbNullString
Exit Sub
End If
End If
If cBDcode > "" Then
txtKPI.Value = WorksheetFunction.VLookup(CLng(cBDcode.Value), Range("Fix"), 2, 0)
If (cBDcode.Value) = "601" Then
txtJobNumber.Visible = True And Label11.Visible = True
Call unlock_update
End If
End If
End Sub
Please help???
Bookmarks