Goto record problem.

sdawson

Registered User.
Local time
Today, 13:55
Joined
Apr 22, 2003
Messages
165
Got a command button that fires of a routine to duplicate a record, reset some fields in the new record and requery the form. Easy.

Because the form is not ordered by the record ID number (alpha numerically by customer) I can not then us goto last record to start data entry in the newly created duplicate record. With me so far?

I need a command to go to specific record number viz. goto Me.ID = NN when NN is the newly created record number.
How?
 
What code are you using so far? Any valid method of copying a partial record should take you to the new record! You cannot, for instance, change some fields on an existing record and then tell Access to "save this as a new record" as many people invariably try to do. You have to copy your data from the original record to variables, move to a new record, then plug these values back in to their respective controls, which leaves you at the new record.
 
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append
Me.Requery

This is the code I'm using and it works fine.
The problem is with the Requery command which put you back the the first record. I need the requery there for other reasons. I was thinking I could save the new record ID in a variable and then call a Docmd to go command to go to the new record.
 

Users who are viewing this thread

Back
Top Bottom