Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21096

Off page printout

$
0
0
I have this code to create a page for the patient.
Code:

Private Sub Label3_Click()
FileCopy "c:\med\headhtm.txt", "c:\med\reffer.hta"
Open "c:\med\tophtm.txt" For Input As #1
Open "c:\med\reffer.hta" For Append As #2
Do While Not EOF(1)
Line Input #1, LineOfText
Print #2, LineOfText
Loop
Close #1
Close #2

Open "a:\patient.txt" For Random As #1 Len = 512
Open "c:\med\reffer.hta" For Append As #2
Open "a:\PATINSU.TXT" For Random As #3 Len = 256
Open "a:\patinsu1.txt" For Random As #4 Len = 256





Print #2, "<H2 ALIGN=CENTER>REFERRAL TO CONSULTANT</H2><B><PRE>";
Print #2, "<div align=center>Printed: "; Left$(Time$, 5); "  "; Left$(Date$, 6); Right$(Date$, 2); "</div>"
Print #2, Tab(LM); "YOU MUST TAKE THIS FORM WITH YOU WHEN YOU GO TO THE CONSULTANT."
Print #2, Tab(LM); "TAKE COPIES OF YOUR LAB REPORTS WITH YOU."
Print #2, Tab(LM); "<u><big>IF YOU FORGET YOUR FORM THERE WILL BE A CHARGE FOR FAXING A COPY.</big></u>"
Print #2,
Dim udtinfo As Info
Get #1, , udtinfo
With udtinfo
sPatientDoB = .Birth
dateDOb = DateSerial(Mid$(sPatientDoB, 7, 2), Mid$(sPatientDoB, 1, 2), Mid$(sPatientDoB, 4, 2))
AGE = DateDiff("yyyy", dateDOb, Date$)
Print #2, "Patient:"; Tab(22); .Name; Tab(60); "BORN "; .Birth; "  AGE"; AGE
Print #2, Tab(22); .addr; Tab(60); "PHONE # "; .phone
Print #2, Tab(22); .Location; Tab(60); "PHONE # "; .work
Print #2,
End With
Dim insu As insu
Get #3, , insu
Print #2, "Insurance:"; Tab(22);
With insu
Print #2, .Insname; ; Tab(22); .InsAddr1; ; Tab(22); .insaddr2; ; Tab(22); .insaddr3; Tab(22); "ID#:&nbsp"; .insid; Tab(22); "GRP#:&nbsp"; .insgrp

Print #2,
End With







Print #2, "<hr>"



Print #2, "<pre><b>" & Form2.Text1.Text & "</b>"

 Dim cace As String, sListItem As String

    Print #2, "<hr>"
    Print #2, "Reason(s) for " & Mid(Form1.List1.Text, 3) & Mid(Form1.List2.Text, 3) & " Consultation:"
Print #2, "ICD#  Reason:"
Open "C:\med\dxtext.txt" For Input As #7
'Open "a:\acutes.txt" For Append As #8
'Print #8, Date$ & "  " & cace
    For k = 0 To List2.ListCount - 1
            sListItem = List2.List(k)
            Do Until EOF(7)
                Line Input #7, cace
                If InStr(1&, cace, sListItem, vbTextCompare) Then
                    Print #2, cace
                    'Print #8, Date$ & "  " & Mid(cace, 7) & Date$ & Mid(Form1.List1.Text, 1, 1) & Mid(cace, 1, 7)
                End If
            Loop
            Seek #7, 1&
    Next
Close #7


Print #2, "<hr>"
Print #2, "<br><center> Notes:</center>"
Print #2, "<pre><b>" & Text1.Text & "</b>"
Print #2,


Print #2, "</center><pre>"


Close
ShellExecute 0, "Open", "c:\med\reffer.hta", "", "", vbNormalFocus
List1.Clear
List2.Clear
Form4.Hide
Form1.Show


End Sub

the problem is that if the note is too long it simply cut off at the end of the page instead of printing the rest below on the next line.... what do i do?

Viewing all articles
Browse latest Browse all 21096

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>