The toolbox referred to is available in Form Design View. The person is
talking about adding a command button to the form. The command button wizard
has as one of its options to make a command button that will duplicate a
record.
The code this wizard creates for the button is:
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
The entries on the menu bar associated with these commands are under the
Edit menu.
1) Select Record
2) Copy
3) Paste Append
Another option is to use the BeforeUpdate event of the form to set the
Default Value of desired controls to their current value. This will cause
those controls to "carry over" their current values as the default in the
next new record. This will work after you have made a change (including
entering a new record) to a record. Just browsing the records won't affect
this.
--
Wayne Morgan
MS Access MVP
"Nhmiller" <nh******@aol.comnojunk> wrote in message
news:20***************************@mb-m15.aol.com...
I searched here for an answer. I am entering records into a database, and
it
would save a lot of time if I could duplicate a record that is very
similar to
the new one I am about to enter, then make one or two changes to the new
one.
This is the problem I have with Access. Look at this answer!
Private Sub btnCopy_Click()
On Error GoTo handle_error
Set cnxn = CurrentProject.Connection
Set rs = New ADODB.Recordset
If IsNull(Me.lstRecords.Value) Then
MsgBox "No item selected", , "Selection Needed"
Else
etc.etc.etc.
When I used Lotus Approach, there was an icon and a dropdown command to
duplicate the record presently being displayed. That was it!
I saved a reply from a while back to the same question I posed:
For instance, duplicating a record is a handy button to have, but there is
none
Here's the reply I got:
"There is one...just click the Command Button icon on the Toolbox and pick
the Records Category and choose Duplicate Record from the right side."
But, how do I get the Tool Box to appear? When I have a record open in
Forms, I
see no icon for Toolbox, I see it in no dropdown menu, and when I enter
"toolbox" in Help, there is nothing about how to access it. When I finally
got
the toolbox to appear, from some options menu (I think), it was completely
grayed when I had a record open in Forms.
Neil
Cat Paintings At Carol Wilson Gallery
http://www.carolwilsongallery.com