Goto New Created Record in current Form (multiuser)

calvinle

Registered User.
Local time
Today, 06:56
Joined
Sep 26, 2014
Messages
332
Hi,

If my form is bound to a table, and the form is open, I add a new record to the table that is bound to that form, is it possible to go to that new record that is just added?
I tried using the below but it says no record found. I guess its normal because the current form is open and did not refresh the new added data?

Code:
Dim rs as Recordset
Dim sCriteria as string

Set rs = Me.Form.Recordsetclone
sCriteria = "[work_id] = """ & sWorkId & """"
If rs.FindFirst sCriteria
Me.Bookmark=rs.Bookmark

'** sWorkId is a global variable that is associate after adding that new record
 
If you added it with code, you'd need to requery the form.
 
Just to see exactly how it is done, use a command-button wizard to add a new record and see how the wizard does it. You are SO close...
 
I did try to add a new record using that same command button then go to that new record, even with a Me.requery after adding the new record. Still doesnt work.

Any idea why?
 
What is the full code?
 

Users who are viewing this thread

Back
Top Bottom