Private
Sub
cmdEintragenST_Click()
If
Stammdaten.Caption =
"Kunde"
Then
If
Me
.txtP1.Text =
False
Then
MsgBox
"Bitte tragen Sie einen Namen ein"
ElseIf
Me
.txtP2.Text =
""
Then
MsgBox
"Bitte tragen Sie einen Vornamen ein"
ElseIf
Me
.txtP3.Text =
""
Then
MsgBox
"Bitte tragen Sie das Datum ein"
ElseIf
Me
.txtP4.Text =
""
Then
MsgBox
"Bitte tragen Sie den Ort ein"
ElseIf
Me
.optFrau.Value
Or
Me
.optMann.Value =
False
Then
MsgBox
"Bitte geben Sie das Geschlecht an"
End
If
With
Tabelle2
Dim
last2
As
Integer
last2 = Tabelle2.Cells(Rows.Count, 1).
End
(xlUp).Row + 1
.Cells(last2, 1).Value =
Me
.txtP1.Text
.Cells(last2, 2).Value =
Me
.txtP2.Text
.Cells(last2, 2).Value =
Me
.txtP3.Text
.Cells(last2, 4).Value =
Me
.txtP4.Text
If
Me
.optFrau.Value =
True
Then
.Cells(last2, 5).Value =
"W"
End
If
If
Me
.optMann.Value =
True
Then
.Cells(last2, 5).Value =
"M"
End
If
End
With
If
Stammdaten.Caption =
"Produkt"
Then
If
Me
.txtP1.Text =
""
Then
MsgBox
"Bitte tragen Sie eine Artikelnummer ein"
ElseIf
Me
.txtP2.Text =
""
Then
MsgBox
"Bitte tragen Sie einen Produktnamen ein"
ElseIf
Me
.txtP3.Text =
""
Then
MsgBox
"Bitte tragen Sie einen Verkaufpreis ein"
ElseIf
Me
.txtP4.Text =
""
Then
MsgBox
"Bitte tragen Sie den Bestand ein ein"
End
If
With
Tabelle4
Dim
last3
As
Integer
last3 = Tabelle4.Cells(Rows.Count, 1).
End
(xlUp).Row + 1
.Cells(last3, 1).Value =
Me
.txtP1.Text
.Cells(last3, 2).Value =
Me
.txtP2.Text
.Cells(last3, 3).Value =
Me
.txtP3.Text
.Cells(last3, 4).Value =
Me
.txtP4.Text
End
With