View Single Post
  #2  
Old January 29th, 2008, 11:36 PM posted to microsoft.public.access.tablesdbdesign
Armen Stein
external usenet poster
 
Posts: 507
Default set focus on a specific record after adding new record

On Tue, 29 Jan 2008 22:07:24 GMT, "jpwgh via AccessMonster.com"
u39688@uwe wrote:

After logging in, you go to a client search form (continuous form lists all
clients). To add a new client, you click on a button to go to the form to
add the new information. On close, you go back to the client search form
(which was never closed). From here, there are one of two places to go.
Problem is, to go to the next form, you must be at the record of the person
you just added. His answer is to do a search using the search button. I
would like to be at the record of the person you just added.


The approach here is to remember the key of the record you just added,
then reposition the main form to that key. Load the new key into a
hidden control on the main form or into a global variable.

When the main form Activates again and there's a new key, Requery the
form. Then create a RecordsetClone of Me.Recordset and do the
FindFirst on the clone. If found, set the Me.Bookmark to the clone's
..Bookmark. That will reposition the form to the newly added record.

Hope this helps,

Armen Stein
Microsoft Access MVP
www.JStreetTech.com