Found this code on this site. It seems to work except for one problem. Only the first five of 20 fields are copied. I have done my due diligence to find some reason for this behavior, but now am appealing to any of you to point me in the right direction.
Some information:
Access 2007
Form where button located is based on a simple query.
There are no error messages, just when I look at the table only the first five fields have data in them, rest are blank.
Last populated field is text. (City Name)
First bland field is text. (State)
Copy and Paste are to same table.
Have spent hours on this, looking for some difference in the field properties, etc. Thank all of you in advance for any help. Maybe someday will be able to pay it forward.
Some information:
Access 2007
Form where button located is based on a simple query.
There are no error messages, just when I look at the table only the first five fields have data in them, rest are blank.
Last populated field is text. (City Name)
First bland field is text. (State)
Copy and Paste are to same table.
Have spent hours on this, looking for some difference in the field properties, etc. Thank all of you in advance for any help. Maybe someday will be able to pay it forward.
Code:
Private Sub cmdDuplicate_Click()
On Error GoTo Err_cmdDuplicate_Click
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdRecordsGoToNew
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdPaste
Exit_cmdDuplicate_Click:
Exit Sub
Err_cmdDuplicate_Click:
MsgBox Err.Description
Resume Exit_cmdDuplicate_Click
End Sub