
MoveFirst, MoveLast strange behavior
Hi Dan.
Thanks for this reminder...
I need to be more detailed.
I inherited an old DB to migrate to Access 2000 from a
customer.
This customer _WANTS_ to keep its old numbering scheme
for the primary table they are using (and that's their
right). This numbering had gates in it (old records
deleted).
I created an autonumber primary key field in the new
Access table. I then created a field with the old numbers
of the customer. There is a univoque relationship between
the two. And then there are all the other data fields.
I then uploaded the data in Access at once.
To automatically create the old number for their new
records I need to access the last record and increment it.
I would expect the last record to be the one with the
higher number in the new autonumber primary key field.
The problem is that Access keeps taking the same record
(not the last one according to the definition I just
provided) even when I continue to enter new records in
the database afterwards. For test purpose I deleted this
record Access considers as the last one. Access then
takes the previous one, and so on if I delete this one...
I thus created a MyMoveLast that just open the recordset
and loop on movenext until the end of the recordset : I
then get the real Last Record !
For your info, I had a similar problem with MoveFirst
when wanting to upload all the data with a module not
displaying anything on a form : Access always started
with the 22nd record : why ? Obscure for me.
It worked perfectly fine when I finally used a dedicated
form coupled with the source table : from the first to
the last in the right order...
Still a mystery to me...