Fehlerschleife
02.07.2007 15:38:00
Christian
ich möchte meine Fehlerschleife dahingehend verändern, dass ein Eintrag in die TextBox4 zum Pflichtfeld wird.
und zwar in den Fällen, in denen TextBox5 die Value "12", "14", "15", "16" enthält.
Das hab ich bisher:
Public Sub Eintragen()
On Error GoTo Fehler
Prüfen:
If TextBox1.Value = "" Then Err.Raise 65535
If TextBox3.Value = "" Then Err.Raise 65533
If ComboBox1.Value = "" Then Err.Raise 65531
If TextBox5.Value = "12" And TextBox4.Value = "" Then Err.Raise 65534 Else GoTo Eintragen
If TextBox5.Value = "14" And TextBox4.Value = "" Then Err.Raise 65534 Else GoTo Eintragen
If TextBox5.Value = "15" And TextBox4.Value = "" Then Err.Raise 65534 Else GoTo Eintragen
If TextBox5.Value = "16" And TextBox4.Value = "" Then Err.Raise 65534 Else GoTo Eintragen
If TextBox7.Value = "" Then Err.Raise 65529
Eintragen:
Fehler:
If Err.Number = 65534 Then MsgBox("Achtung Pflichtfeld !") : Goto Prüfen
If Err.Number = 65527 Then MsgBox ("Bitte Gewinn/Verlust auswählen !"): Exit Sub
If Err.Number = 65535 Then MsgBox ("Filiale bitte eingeben !"): TextBox1.SetFocus: Exit Sub
If Err.Number = 65533 Then MsgBox ("Bitte Betrag angeben !"): TextBox3.SetFocus: Exit Sub
If Err.Number = 65531 Then MsgBox ("Bitte wählen Sie einen Stornogrund aus !"): ComboBox1. _
SetFocus: Exit Sub
If Err.Number = 65534 Then MsgBox ("Bitte geben Sie hier unter Bemerkungen Ihren Namen ein !"): _
_
TextBox4.SetFocus: GoTo Prüfen
If Err.Number = 65529 Then MsgBox ("Zu dieser betreuenden Stelle" ): TextBox7.SetFocus: Exit _
Sub
End Sub