leaf
12-13-2016, 02:04 AM
Hello everybody,
I'm new here but I've seen You guys have a lot of konwledge with VBA and maybe You would help me :)
I have got userform like below.
17826
After pressing "Enter" cursor automaticly goes down from ID_TextBox to Indeksy_ComboBox where is one IF function (must be there). Here comes my problem.
I would like to have possibility to press Exit_CommandButton at anytime. Now it is impossible, untill i put 7 characters into Indeksy_ComboBox.
Once again, cursor goes to ComboBox and it requires 7 characters, until any other action is possible (MsgBox appears).
I hope i explained it well :)
17827
I have got code like below.
Private Sub Indeksy_ComboBox_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Len(Indeksy_ComboBox.Value) < 7 Then
MsgBox "Insert apropriate value"
Cancel = True
End If
End Sub
Private Sub Exit_CommandButton_Click()
Application.DisplayAlerts = False
Unload Me
End Sub
Do You have any idea how to solve it?
Additional If function in Indeksy_ComboBox_Exit Sub?
Thank You in advance!
I'm new here but I've seen You guys have a lot of konwledge with VBA and maybe You would help me :)
I have got userform like below.
17826
After pressing "Enter" cursor automaticly goes down from ID_TextBox to Indeksy_ComboBox where is one IF function (must be there). Here comes my problem.
I would like to have possibility to press Exit_CommandButton at anytime. Now it is impossible, untill i put 7 characters into Indeksy_ComboBox.
Once again, cursor goes to ComboBox and it requires 7 characters, until any other action is possible (MsgBox appears).
I hope i explained it well :)
17827
I have got code like below.
Private Sub Indeksy_ComboBox_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Len(Indeksy_ComboBox.Value) < 7 Then
MsgBox "Insert apropriate value"
Cancel = True
End If
End Sub
Private Sub Exit_CommandButton_Click()
Application.DisplayAlerts = False
Unload Me
End Sub
Do You have any idea how to solve it?
Additional If function in Indeksy_ComboBox_Exit Sub?
Thank You in advance!