|
-
Nov 29th, 1999, 02:22 PM
#2
Lively Member
You should open the file for "input" NOT "append".
Append sets you to the end of the file,input sets you to the begining of the file.
Also in the strFileName, include the extention of the file
ie: "D:\MovieRental.Txt"
Also everytime you loop thrugh the code reading in a line from the file, you are overwriting the previously read line without storing the information.
Try something like
Create an array of TextBoxes called
txtMyTextBox, then use the following code
Private strLineInfo() as String
intLC = 0
Open strFileName for Input as #1
Do While NOT EOF(1)
ReDim Preserve strLineInfo(intLC)
Input #1,strLineInfo(intLC)
intLC = intLC + 1
Loop
Close #1
For n = 0 to intLC
txtMyTextBox(n).Text = strLineInfo(n)
Next n
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|