Solved

how do I get this code to priiint

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…

733 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