Access Form_Record Persistance

J

Jagstrom

When I open my form I would like to be at the last record viewed
instead of always starting at the 1st record. Any easy ways to
accomplish this?
 
D

Douglas J. Steele

No easy way.

You'd need to create a table to which you'd write the details of the current
record in the form's Unload event, and then read that table and navigate to
the record in the form's Load event.
 
M

mscertified

Well first you need to store the last record viewed somewhere. And if this is
a multi-user database there might be many 'last viewed' records so you'd need
to store for each user. Then there is the possibility that the last record
you viewed got deleted by someone else so its no longer there.

So you would store the primary key of the last record viewed in a table and
then in the form open event you would retrieve this key and then read the
record. If the record still exists you would do a docmd.gotorecord to
position to it.
Of course in the form close event you must again replace the last viewed
record with the new one.

-Dorian
 
A

a a r o n . k e m p f

Store _ALL_ your variables in a table / tables instead of passing them
around.

I've followed this strategy, almost exclusively for a long long long
time.

-Aaron
 
Top