How do I place duplicate directly below the copied record?

5 pts.
Tags:
Microsoft Access
Microsoft Access forms
I have code (below) which works perfectly today attached to a button to copy a record in a form. But, it inserts the new record at the bottom of the form, I would like to make it past the new record immediately below the copied record. Is there a way to do this?

Private Sub Duplicate_Record_Click() On Error GoTo Err_Duplicate_Record_Click DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70 DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append Exit_Duplicate_Record_Click: Exit Sub Err_Duplicate_Record_Click: MsgBox Err.Description Resume Exit_Duplicate_Record_Click

End Sub



Software/Hardware used:
MS Access
ASKED: January 20, 2010  3:20 PM
UPDATED: January 21, 2010  2:14 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

A form is just a method of displaying the records, so it doesn’t go about ordering them in any way, unless you specify a sort order in your query. If the records have an id of some description that you can use to group them, then use that as the order by clause, and then rerun the query to update the form and display the records in order.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following