Solved

how do I get this code to priiint

Posted on 2002-06-22
2
145 Views
Last Modified: 2010-08-05

Dim inv As String * 8
Dim ddate As String * 9
Dim amt As String * 7
Dim amt5 As String * 7
Dim deal As String * 15
Dim paid As String * 3

Open "C:\invoice\dollar.dat" For Input As #1
a = 0
B = 0
Do Until EOF(1)
Input #1, inv, ddate, amt, amt5, deal, paid
a = a + amt
B = B + amt5
Loop
Close #1
Form1.Text1.Text = Val(a)
Form1.TEXT2.Text = Val(B)


8888888888888888888888888888888888888888888888888888888

after I print the contents of this file, what code do I need to print the val of a & b at the end of the printout?

I am using vb 4.
thanks
0
Comment
Question by:hjaycox
2 Comments
 
LVL 18

Accepted Solution

by:
Crash2100 earned 50 total points
ID: 7101265
Something like this?



Dim inv As String * 8
Dim ddate As String * 9
Dim amt As String * 7
Dim amt5 As String * 7
Dim deal As String * 15
Dim paid As String * 3

Dim a as integer
dim B as integer

Open "C:\invoice\dollar.dat" For Input As #1
a = 0
B = 0

Do Until EOF(1)
     Input #1, inv, ddate, amt, amt5, deal, paid

     Printer.Print "***********"
     Printer.Print "Inv: "; trim(inv)
     Printer.Print "Ddate: "; trim(ddate)
     Printer.Print "Amt5: "; trim(amt5)
     Printer.Print "Deal: "; trim(deal)
     Printer.Print "paid: "; trim(paid)
     Printer.Print

     a = a + val(amt)
     B = B + val(amt5)
Loop

Close #1

Printer.Print
Printer.Print "**** Totals ****"
Printer.Print "Amt: "; str(a)
Printer.Print "Amt5: "; str (B)
0
 
LVL 4

Expert Comment

by:TomLaw1999
ID: 7101663
Printer.Print Text1
Printer.Print Text2
Printer.EndDoc
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now