Create navigation to last used records

G

Guest

I am trying to create previous and next buttons on a form to access up to
five records in either direction. Has anybody any ideas?
 
J

John Nurick

Hi Mark,

You'll need to create a stack of some kind to store the primary keys of
each record you visit, together with - I guess - a timestamp. In the
Current event handler of the form, include code to put the current
record's bookmark or primary key onto the stack and (if there are more
than 10 items in the stack) delete the oldest.

Then have code for each of the buttons to retrieve the relevant item
from the stack and navigate the form to it.

It's simpler and quicker to use bookmarks than primary key values, but
they are invalidated if the form is closed and re-opened or even
re-queried. If you want the stack to persist while the database is
closed, implement it as a table, an .ini file or Windows registry
settings. Otherwise, you could keep it in memory (an array or a
collection, perhaps).

On Tue, 4 Jan 2005 09:29:03 -0800, "Mark Dudley" <Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top