Re: beim speichern beendet sich das programm
08.03.2003 22:10:55
Karina
hallo peter,hier ist der code
für den ersten speicherbutton
Workbooks("VBA.xls").Worksheets("Kunden").Activate
Dim ereignis As Integer
Dim i As Integer
i = 2
Do While Cells(i, 1).Value <> "" 'durchlaufe die schleife solang, bis die zeile ungleich nichts ist, dann trage ein
i = i + 1
Loop
Cells(i, 1).Value = TextBox13.Value 'kundennr
Cells(i, 2).Value = TextBox1.Value 'unternehmen
Cells(i, 3).Value = TextBox2.Value 'name
Cells(i, 4).Value = TextBox3.Value 'vorname
Cells(i, 5).Value = TextBox4.Value 'str
Cells(i, 6).Value = TextBox5.Value 'plz
Cells(i, 7).Value = TextBox7.Value 'ort
Cells(i, 8).Value = TextBox9.Value 'tel
Cells(i, 9).Value = TextBox8.Value 'fax
Cells(i, 10).Value = TextBox11.Value 'e-mail
Cells(i, 11).Value = TextBox10.Value 'mobile
Cells(i, 12).Value = TextBox27.Value 'bank
Cells(i, 13).Value = TextBox28.Value 'blz
Cells(i, 14).Value = TextBox29.Value 'konto
Cells(i, 17).Value = TextBox70.Value 'Liefername1
Cells(i, 18).Value = TextBox69.Value 'Liefername2
Cells(i, 15).Value = TextBox62.Value 'Lieferadresse1
Cells(i, 16).Value = TextBox63.Value 'Lieferadresse2
Cells(i, 19).Value = TextBox67.Value 'PLZ
Cells(i, 20).Value = TextBox68.Value 'Ort
Cells(i, 21).Value = TextBox80.Value 'Kontonummer
If TextBox27.Value = " " Then
ereignis = MsgBox("Ein benötiger Eintrag fehlt", 0 + 64 + 0, "Fehlender Eintrag")
End If
If TextBox28.Value = " " Then
ereignis = MsgBox("Ein benötiger Eintrag fehlt", 0 + 64 + 0, "Fehlender Eintrag")
End If
If TextBox29.Value = " " Then
ereignis = MsgBox("Ein benötiger Eintrag fehlt", 0 + 64 + 0, "Fehlender Eintrag")
End If
If TextBox2.Value = " " Then
ereignis = MsgBox("Ein benötiger Eintrag fehlt", 0 + 64 + 0, "Fehlender Eintrag")
End If
If TextBox1.Value = " " Then
ereignis = MsgBox("Ein benötiger Eintrag fehlt", 0 + 64 + 0, "Fehlender Eintrag")
End If
If TextBox13.Value = " " Then
ereignis = MsgBox("Ein benötiger Eintrag fehlt", 0 + 64 + 0, "Fehlender Eintrag")
End If
If TextBox5.Value = " " Then
ereignis = MsgBox("Ein benötiger Eintrag fehlt", 0 + 64 + 0, "Fehlender Eintrag")
End If
If TextBox7.Value = " " Then
ereignis = MsgBox("Ein benötiger Eintrag fehlt", 0 + 64 + 0, "Fehlender Eintrag")
End If
'End If
Unload Me
End Sub