WastinAway
Technical User
I can't get my program to run with these to commands in this script together. What can I do to allow it to run with them both in it? here is what I have, thanks! I have to take [Private Sub form_load()] out before the program will run.
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
Open "Tax Total" For Append As #3
Print #3, txttax.Text
Close #3
End Sub
Private Sub form_load()
Dim RunTotal As Single
Dim RunTotal2 As Single
Dim taxtotal As Single
Dim a As String
Dim b As String
Dim c 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")
Open "Tax Total" For Input As #3
Do Until EOF(3)
Line Input #3, c
taxtotal = taxtotal + CCur(c)
Loop
Close #3
txttaxtotal.Text = Format(taxtotal, "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
Open "Tax Total" For Append As #3
Print #3, txttax.Text
Close #3
End Sub
Private Sub form_load()
Dim RunTotal As Single
Dim RunTotal2 As Single
Dim taxtotal As Single
Dim a As String
Dim b As String
Dim c 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")
Open "Tax Total" For Input As #3
Do Until EOF(3)
Line Input #3, c
taxtotal = taxtotal + CCur(c)
Loop
Close #3
txttaxtotal.Text = Format(taxtotal, "Currency")
End Sub