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

text box assistance

$
0
0
I am trying to get this code working but it is turning up errors. I want the program to access the information from a random access file that is pre generated and write it to another file in standard text format. I have the settings right for reading the file i think but how do i get it to output that info. Here is what i have but it doesn't work. Al i get is a blank text file with the Labels but no information.


Code:

Private Type Info
ID As String * 12
Name As String * 30
Gender As String * 1
Addr As String * 30
Birth As String * 8
End Type
Private Sub Command1_Click()
Open "A:\patient.txt" For Random As #1 Len = 256
Open "c:\test\Patient.txt" For Output As #2
      Print #2, "ID:"; ID
      Print #2,
      Print #2, "Name: "; Name
      Print #2,
      Print #2, "Gender: "; Gender
      Print #2,
      Print #2, "Address: "; Addr
      Print #2,
      Print #2, "Birth: "; Birth
      Close #2
      Close #1
End Sub


Viewing all articles
Browse latest Browse all 21849

Trending Articles



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