Hi hier mein kleines Programm. Ich bekomme es nicht hin das ich mehrere Daten speichere ohne dass ich die vorherigen überschreibe
Private Sub cmdOpen_Click()
Dim Wert1 As Double
Dim Wert2 As Double
DateiNr = FreeFile
Open "Zahlen.dat" For Binary As DateiNr
Get DateiNr, , Wert1
Get DateiNr, , Wert2
Text7.Text = " Wert für g(x) = " & Wert1 & " Wert für x = " & Wert2
Close DateiNr
End Sub
Private Sub cmdSave_Click()
If IsNumeric(Text5.Text) = True Then
curKapital = Text5.Text
Else
MsgBox Prompt:="Bitte erst Werte eingeben"
Exit Sub
End If
DateiNr = FreeFile
Dim Wert1 As Double
Dim Wert2 As Double
Wert1 = Text5.Text
Wert2 = Text2.Text
Open "Zahlen.dat" For Binary As DateiNr
Put DateiNr, , Wert1
Put DateiNr, , Wert2
Close DateiNr
End Sub
Private Sub Command1_Click()
Text5.Visible = True
Picture1.Visible = False
Dim k As Double
Dim pi As Double
pi = 3.141592654
If IsNumeric(Text1.Text) = True Then
intLaufzeit = Text1.Text
Else
MsgBox Prompt:="Bitte für den Radius R eine Zahl eingeben!"
Text1.SetFocus
Exit Sub
End If
If IsNumeric(Text2.Text) = True Then
curKapital = Text2.Text
Else
MsgBox Prompt:="Bitte für den Abstand x eine Zahl eingeben!"
Text2.SetFocus
Exit Sub
End If
If IsNumeric(Text3.Text) = True Then
sngZinssatz = Text3.Text
Else
MsgBox Prompt:="Bitte für die Teufe z eine Zahl eingeben!"
Text3.SetFocus
Exit Sub
End If
If IsNumeric(Text4.Text) = True Then
intLaufzeit = Text4.Text
Else
MsgBox Prompt:="Bitte für die mittlere Dichte p eine Zahl eingeben!"
Text4.SetFocus
Exit Sub
End If
If IsNumeric(Text6.Text) = True Then
intLaufzeit = Text6.Text
Else
MsgBox Prompt:="Bitte für die Konstante k eine Zahl eingeben!"
Text6.SetFocus
Exit Sub
End If
Text1a = Text1.Text
Text2a = Text2.Text
Text3a = Text3.Text
Text4a = Text4.Text
Text6a = Text6.Text
Text5 = (4 * pi * Text6a * Text4a * Text1a ^ 3) / (3 * Text3a ^ 2) * (1 + Text2a ^ 2 / Text3a ^ 2) ^ (-3 / 2)
End Sub
Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
Private Sub Text1_Change()
Dim Text1a As Double
End Sub
Private Sub Text2_Change()
Dim Text2a As Double
End Sub
Private Sub Text3_Change()
Dim Text3a As Double
End Sub
Private Sub Text4_Change()
Dim Text4a As Double
End Sub
Private Sub Text5_Change()
Dim Text5a As Currency
End Sub
Private Sub Text6_Change()
Dim Text6a As Double
End Sub
Private Sub cmdOpen_Click()
Dim Wert1 As Double
Dim Wert2 As Double
DateiNr = FreeFile
Open "Zahlen.dat" For Binary As DateiNr
Get DateiNr, , Wert1
Get DateiNr, , Wert2
Text7.Text = " Wert für g(x) = " & Wert1 & " Wert für x = " & Wert2
Close DateiNr
End Sub
Private Sub cmdSave_Click()
If IsNumeric(Text5.Text) = True Then
curKapital = Text5.Text
Else
MsgBox Prompt:="Bitte erst Werte eingeben"
Exit Sub
End If
DateiNr = FreeFile
Dim Wert1 As Double
Dim Wert2 As Double
Wert1 = Text5.Text
Wert2 = Text2.Text
Open "Zahlen.dat" For Binary As DateiNr
Put DateiNr, , Wert1
Put DateiNr, , Wert2
Close DateiNr
End Sub
Private Sub Command1_Click()
Text5.Visible = True
Picture1.Visible = False
Dim k As Double
Dim pi As Double
pi = 3.141592654
If IsNumeric(Text1.Text) = True Then
intLaufzeit = Text1.Text
Else
MsgBox Prompt:="Bitte für den Radius R eine Zahl eingeben!"
Text1.SetFocus
Exit Sub
End If
If IsNumeric(Text2.Text) = True Then
curKapital = Text2.Text
Else
MsgBox Prompt:="Bitte für den Abstand x eine Zahl eingeben!"
Text2.SetFocus
Exit Sub
End If
If IsNumeric(Text3.Text) = True Then
sngZinssatz = Text3.Text
Else
MsgBox Prompt:="Bitte für die Teufe z eine Zahl eingeben!"
Text3.SetFocus
Exit Sub
End If
If IsNumeric(Text4.Text) = True Then
intLaufzeit = Text4.Text
Else
MsgBox Prompt:="Bitte für die mittlere Dichte p eine Zahl eingeben!"
Text4.SetFocus
Exit Sub
End If
If IsNumeric(Text6.Text) = True Then
intLaufzeit = Text6.Text
Else
MsgBox Prompt:="Bitte für die Konstante k eine Zahl eingeben!"
Text6.SetFocus
Exit Sub
End If
Text1a = Text1.Text
Text2a = Text2.Text
Text3a = Text3.Text
Text4a = Text4.Text
Text6a = Text6.Text
Text5 = (4 * pi * Text6a * Text4a * Text1a ^ 3) / (3 * Text3a ^ 2) * (1 + Text2a ^ 2 / Text3a ^ 2) ^ (-3 / 2)
End Sub
Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
Private Sub Text1_Change()
Dim Text1a As Double
End Sub
Private Sub Text2_Change()
Dim Text2a As Double
End Sub
Private Sub Text3_Change()
Dim Text3a As Double
End Sub
Private Sub Text4_Change()
Dim Text4a As Double
End Sub
Private Sub Text5_Change()
Dim Text5a As Currency
End Sub
Private Sub Text6_Change()
Dim Text6a As Double
End Sub