Solved

how do I get this code to priiint

Posted on 2002-06-22
2
150 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
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…

728 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