INvicta
Board Regular
- Joined
- May 18, 2007
- Messages
- 108
I've used the Duplicate Record option on a form's command button but can't work out how to adapt it so that it only copies a couple of text fields.
I've also been asked if it's possible to stipulate the number of copies but thats not a prerequisite.
Using the standard code I've got as far as the following, any suggestions would be very welcome.
Bernard
I've also been asked if it's possible to stipulate the number of copies but thats not a prerequisite.
Using the standard code I've got as far as the following, any suggestions would be very welcome.
Bernard
Code:
Private Sub CmdDuplicateRecord_Click()
On Error GoTo Err_CmdDuplicateRecord_Click
Dim txtStockCodeNo As String
Dim txtFixtureNumberCom As String
Dim dbs As Dtabase
Dim rst As Recordset
Dim i As Integer
'Following Duplicates ALL fields - from in-built duplicate record "Wizard" function in Access
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 2, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 5, , acMenuVer70 'Paste Append
Exit_CmdDuplicateRecord_Click:
Exit Sub
Err_CmdDuplicateRecord_Click:
MsgBox Err.Description
Resume Exit_CmdDuplicateRecord_Click
'How to duplicate two specific Text fields? eg StockCodeNo and FixtureNumberCom
'How to duplicate any number of these?
End Sub