Results 1 to 2 of 2
2003-03-26, 23:51 #1
- Join Date
- Mar 2001
- Atlanta, Georgia, USA
- Thanked 0 Times in 0 Posts
Maintaining a stack of previous records (Access 2000, SP1)
I've been asked to add a button to a form that is a 'Back to previous customer' function. When pressed, it will display the last form that was viewed. I have a primary key that is an autonumber, so performing a query to get the record is no big deal, but I had hoped that it would have been as simple as a DoCmd, but that doesn't seem to be the case. I have no problem maintaining an array to hold the list of autonumbers, so it seems to be just a matter of decrementing my 'stack' pointer to the previous autonumber, do a query, then repopulating the form. Am I off track here?
2003-03-27, 00:01 #2
- Join Date
- Mar 2002
- Thanked 30 Times in 30 Posts
Re: Maintaining a stack of previous records (Access 2000, SP1)
If your form is bound, you don't need to run a query, you can use the standard technique for locating a record in a form: perform a FindFirst on a clone of the form's recordset, then set the bookmark of the form to the bookmark of the recordset.
An array of previously viewed Primary Keys is fine, but you might also consider using a collection.