Prüfung ob Textfelder ausgefüllt sind
14.12.2003 15:06:54
Roland
in meiner Userform sollen alle Textfelder ausgefüllt sein, und falls dies nicht der Fall sein sollte, erscheint eine MsgBox.
Doch bei meinem Code erscheint die Meldung auch, wenn alle ausgefüllt sind, was hab ich falsch gemacht?
Dim bool As Boolean
bool = False
If Textbox1.Text = "" Then
bool = True
End If
If TextBox2.Text = "" Then
bool = True
End If
If TextBox3.Text = "" Then
bool = True
End If
If Textbox4.Text = "" Then
bool = True
End If
If bool = True Then
MsgBox ("Bitte alle Felder ausfüllen")
End If
End Sub
Gruß
R.