02.06.2021, 18:39
Hallo Sabina, das klingt gut.... passt aber trotzdem nicht.
Der Cursor springt trozdem in die nächste Textbox und der Text wird auch nicht markiert.
Laut MS-Hilfe:
Evtl. ist das die Ursache? Wie wird Cancel auf True gesetzt? Cancel = True? An welcher Stellle im Code?
Danke
Stefan
Code:
Private Sub Pg2txtSollkonto_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
If Len(Pg2txtSollkonto) <> 4 Then
MsgBox "Die Kontobezeichnung besteht aus 4 Zahlen!", vbOKOnly Or vbExclamation, "Bitte Eingabe überprüfen"
With Pg2txtSollkonto
.SetFocus
.SelStart = 0
.SelLength = Len(Pg2txtSollkonto)
End With
End If
End Sub
Der Cursor springt trozdem in die nächste Textbox und der Text wird auch nicht markiert.
Laut MS-Hilfe:
Zitat:Wenn Sie das Abbrechen-Argument auf True festlegen, bleibt der Fokus auf dem Steuerelement, und weder das AfterUpdate-Ereignis noch das Exit-Ereignis tritt ein.
Evtl. ist das die Ursache? Wie wird Cancel auf True gesetzt? Cancel = True? An welcher Stellle im Code?
Danke
Stefan