WastinAway
Technical User
Everything is working properly in this program. Except It won't let me run the program unless I already have a $0.00 dollar amount entered in the saved file. How can I fix that? Here is my script! Thanks for everyone's help.
Private Sub Save_Click()
Open "Running Total" For Append As #1
Print #1, txttotal.Text
Close #1
Open "Running Total 2" For Append As #2
Print #2, txttotal2.Text
Close #2
End Sub
Private Sub form_load()
Dim RunTotal As Single
Dim RunTotal2 As Single
Dim a As String
Dim b As String
Open "Running Total" For Input As #1
Do Until EOF(1)
'' Read the line from the text file''
Line Input #1, a
'' Convert the read string into a currency, and add it to a running total ''
RunTotal = RunTotal + CCur(a)
Loop
Close #1
'' Put the running total into the appropriate text box ''
txtruntotal.Text = Format(RunTotal, "currency")
Open "Running Total 2" For Input As #2
Do Until EOF(2)
Line Input #2, b
RunTotal2 = RunTotal2 + CCur(b)
Loop
Close #2
txtruntotal2.Text = Format(RunTotal2, "Currency")
End Sub
Private Sub Save_Click()
Open "Running Total" For Append As #1
Print #1, txttotal.Text
Close #1
Open "Running Total 2" For Append As #2
Print #2, txttotal2.Text
Close #2
End Sub
Private Sub form_load()
Dim RunTotal As Single
Dim RunTotal2 As Single
Dim a As String
Dim b As String
Open "Running Total" For Input As #1
Do Until EOF(1)
'' Read the line from the text file''
Line Input #1, a
'' Convert the read string into a currency, and add it to a running total ''
RunTotal = RunTotal + CCur(a)
Loop
Close #1
'' Put the running total into the appropriate text box ''
txtruntotal.Text = Format(RunTotal, "currency")
Open "Running Total 2" For Input As #2
Do Until EOF(2)
Line Input #2, b
RunTotal2 = RunTotal2 + CCur(b)
Loop
Close #2
txtruntotal2.Text = Format(RunTotal2, "Currency")
End Sub