By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,906 Members | 1,750 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,906 IT Pros & Developers. It's quick & easy.

extract a record from a Random file

P: 1
I am looking for the code to extract just one record from my file and print to a Form. Spent two days on the net but can not find the answer any where.

The code below works fine but not for a single record.
Any ideas?

Private Sub Command4_Click()
' Sub ReadRandom()

Dim P As Person

Open "RANDOM.XXX" For Random As #1 Len = Len(P)
For i = 1 To Int(LOF(1) / Len(P))
Get #1, i, P
Print Tab(50); P.LName; Tab(60); P.FName; Tab(70); P.Age
Next

Close #1

End Sub
Jan 12 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.