by G.Chandrasekar (2 Submissions)
Category: Files/File Controls/Input/Output
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 26th July 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Creates a file and links it to richtext box for viewing
API Declarations
and create rs1 as recordset with a richtextbox
Dim rs1 As Recordset
Dim fno As Integer
Dim s As String
fno = FreeFile()
Open App.Path & "\report.txt" For Output As #fno
Set rs1 = db.OpenRecordset("select * from "database name no double cotes ex:receive" where place='" & Combo1.Text & "' and date between cdate('" & dt1.Value & "') and cdate('" & dt2.Value & "') order by date")
If rs.RecordCount > 0 Then
Print #fno, Space(40 - (Len("Report") / 2)) & "REPORT"
Print #fno, String(80, "_")
Print #fno, "Place" & Space(7) & "Date" & Space(10) & "Application No" & Space(11) & "Status"
Print #fno, String(80, "_")
Do While Not rs1.EOF
If rs1!entered = True Then
s = "Entered"
Else
s = " Not Entered"
End If
Print #fno, rs1!Place & Space(12 - Len(rs1!Place)) & rs1!Date _
& Space(18 - Len(rs1!applicationno)) & rs1!applicationno & Space(10 - rs1!entered) & s
rs1.MoveNext
Loop
End If
Close #fno
rt.FileName = App.Path & "\report.txt"
End Sub