You have this routine:
Code:
Sub SaveCurrentRecord()
'Fill Person with the currently displayed data
'Name
Person.FileName = txtName.Text
'Age
Person.FileAge = txtAge.Text
'Save Person to the current record.
Put #FileNum, CurrentRecord, Person
End Sub
but i can't see where CurrentRecord is ever changed (increased) , so it seems to write to the same part of the file all the time. Should we not be increasing current record?
also you have this:
Code:
Sub FillGrid()
grdDummy.Row = CurrentRecord
grdDummy.Col = 1
grdDummy.Text = Person.FileName
grdDummy.Col = 2
grdDummy.Text = Person.FileAge
End Sub
but current record is always set to 1. so it always writes to the same row in the grid.
Here we have a problem. For writing to the file we need to increase the current record by the recordlength, but for writing to the grid we need to increase the current record by 1.
I think sorting the data is going to be easy, but first we need some data to sort. I am not trying to critises, i am just trying to help. It's quite difficult cause i don't have vb3.
Give me your thoughts on the currentrecord variable, in the mean time i will keep looking at your code......
Stevesoft
Enter your message below
Sign in or Join us (it's free).