Refresh current field values with Move 0 instead of MoveNext/Previous

The MoveFirst, MoveNext, MovePrevious, and MoveLast methods have been a part of Microsoft Access since it was first released. Microsoft Access 2.0 introduced a complementary method called Move. While at first glance this method may seem superfluous, a closer examination reveals that it is actually quite a powerful substitute for the four existing methods and also has a couple of unique uses of its own.

Perhaps one of the most useful and yet most unintuitive uses for Move is the following statement:


rstData.Move 0

What affect does this have? In the form given above, this will force the Jet engine to re-fetch the data underlying the current record. This might be useful if the cursor position hasn't changed in a while and you wish to be sure that the most current record is going to be edited. As the code example shows, this is faster than the equivalent MoveNext and MovePrevious, and also avoids complications with the cursor being on the last record.

See also tip #34.