View Single Post
  #5  
Old January 30th, 2008, 05:52 AM posted to microsoft.public.access.tablesdbdesign
jpwgh via AccessMonster.com
external usenet poster
 
Posts: 8
Default set focus on a specific record after adding new record

Thank you for your suggestions. Using the books I have, I found some code,
but I can't seem to make it work. I don't have a very good understanding of
how cloning and bookmarks work. I was going to include the code and ask for
further advice, but after reading the other feedback, I am not sure if it is
appropriate for me to ask for help on this.

I do thank you for your consideration and time.

Armen Stein 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

[quoted text clipped - 3 lines]
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


--
Message posted via http://www.accessmonster.com