Please help.
Can you help with the code I require?
I have tried but I don't seem to beable to get it right.

I have simple I/O Random FIle which works fine but I would like to
be able to input a string into a textbox to find the record in the the file using the last name and first name and then maybe in another textbox find any reccuring last names. All my input is printed to form.

Type Person
      LName As String * 12
      FName As String * 8
      Age As Integer
   End Type

Private Sub Command4_Click()

   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
       Close #1
   End Sub

Private Sub Command2_Click()

   Dim P As Person 
       Open "RANDOM.XXX" For Random As #1 Len = Len(P)
       P.LName = LName.Text
       P.FName = FName.Text
       P.Age = Age.Text  '9
       Put #1, , P
       Close #1
End Sub

I think I have put bbcode in the right way.

Edited by Nick Evan: Fixed formatting

8 Years
Discussion Span
Last Post by vb5prgrmr
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.