Solved

how do I get this code to priiint

Posted on 2002-06-22
2
146 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

863 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

20 Experts available now in Live!

Get 1:1 Help Now