Fehlerschleife
13.09.2007 18:15:00
Christian
ich habe eine Fehlerschleife programmieren wollen, doch leider hakt da etwas.
Ich bekomme die Fehlermeldung: "Sprugmarke nicht definiert"
Frage: warum muss ich die Sprungmarke definieren ?
Private Sub CommandButton1_Click()
Prüfen
End Sub
Private Sub CommandButton2_Click()
Hide
End Sub
Public Sub Prüfen()
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 Fehlerende
'If TextBox5.Value = "14" And TextBox4.Value = "" Then Err.Raise 65534: GoTo TextBox5 Else GoTo _
Fehlerende
'If TextBox5.Value = "15" And TextBox4.Value = "" Then Err.Raise 65534: GoTo TextBox5 Else GoTo _
Fehlerende
'If TextBox5.Value = "16" And TextBox4.Value = "" Then Err.Raise 65534: GoTo TextBox5 Else GoTo _
Fehlerende
If TextBox2.Value = "" Then Err.Raise 65529
Eintragen:
Fehler:
If Err.Number = 65534 Then MsgBox ("Bitte geben Sie hier unter Bemerkungen Ihren Namen ein !"): _
TextBox5.SetFocus
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 = 65529 Then MsgBox ("Zu dieser betreuenden Stelle" + Chr(13) + "ist noch kein _
Regionalbereich gespeichert" + Chr(13) + "Bitte rufen Sie " + Chr(13) + "unter Tel.: 71 67 an !"): TextBox7.SetFocus: Exit Sub
Fehlerende:
Exit Sub
Resume Next
End Sub
Public Sub Eintragen()