
Please Help Urgent help needed!!!!
Manoj,
My first reaction is that the order in which the data is viewed/returned to
your recordset will be determined by the indexes/sorting/keys which are
setup in the tables or which are set up in the statements to retreive the
data.
My expectation would be that the record is added at the end and then the
next time you look at a table it may be in the middle because, for example,
your primary key is last name and set to be sorted in ascending order.
As one solution which (I think) is independant of the reason why this is
happening, use a piece of data to determine which records are "earlier" than
the one being added, set a filter on the recordset to restrict the data to
that, iterate over the filtered data to do your calculations, then remove
the filter. There are several other ways to do the calculations, the key is
using a piece of data to determine "previous" records.
If no such logical piece of data exists, add a "record creation date/time"
field. You could also use an autonumber field but this could be dangerous
depending on the specifics of your application (replication, number of
records, etc...)
John
Quote:
> Hi guys
> I have been creating this application using VB and Access 2000
> now after some time and when i thought the application is coming to its
end
> i find a BIG problem....
> i have been adding records to a table and when i do it, i usually
calculate
> the values of this new record using the previous records...so i use
> Moveprevious and such things to calculate the new values....
> But now i think my whole application is going to crash....because from
last
> tzo days the program has been inserting the new records just anywhere in
the
> middle instead of in the end of the table....Is there a specific thing i
> have to do to make the new added recorded always be added in the end of
the
> table or as the last record....
> Please guys help and looking for some positive reply at the earliest
> Cheers
> manoj