Wie kann ich bitte mit dem nachstehenden Code erreichen, dass wenn beim Verlassen der Textbox2 die Textbox2 noch leer ist, die TextBox2 neuerlich für eine Eingabe aktiviert wird?
Danke
Josef
Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
On Error GoTo 90
'On Error Resume Next
Dim arrZahlen(10) As Long, lngI As Long
For lngI = 0 To 9
arrZahlen(lngI) = CLng(Mid(TextBox2, lngI + 1, 1))
Next lngI
TextBox21.Text = arrZahlen(0) * 3
TextBox22.Text = arrZahlen(1) * 7
TextBox23.Text = arrZahlen(2) * 9
TextBox32.Text = arrZahlen(3)
TextBox24.Text = arrZahlen(4) * 5
TextBox25.Text = arrZahlen(5) * 8
TextBox26.Text = arrZahlen(6) * 4
TextBox27.Text = arrZahlen(7) * 2
TextBox28.Text = arrZahlen(8) * 1
TextBox29.Text = arrZahlen(9) * 6
TextBox30 = CDbl(TextBox21) + CDbl(TextBox22) + CDbl(TextBox23) + CDbl(TextBox24) + _
CDbl(TextBox25) + CDbl(TextBox26) + CDbl(TextBox27) + CDbl(TextBox28) + CDbl(TextBox29)
TextBox31.Text = TextBox30 Mod 11
If TextBox32.Text = TextBox31 Then
TextBox2.Text = TextBox2
Label48.Caption = "VSNR OK"
'If TextBox2.Text = "" Then
'Label48.Caption = ""
'End If
With TextBox3
.SetFocus: .SelStart = 0: .SelLength = Len(.Text)
End With
Else
TextBox2.Text = ""
Cancel = True
Label48.Caption = "VSNR falsch"
With TextBox2
.SetFocus: .SelStart = 0: .SelLength = Len(.Text)
End With
End If
90:
If TextBox2.Text = "" Then
Label48.Caption = ""
With TextBox1
.SetFocus: .SelStart = 0: .SelLength = Len(.Text)
End With
End If
End Sub