|
把Cmd_复制_Click()的过程修改如下,不要【C_CB102产品复制】了
Private Sub Cmd_复制_Click()
On Error GoTo Err_Cmd_复制_Click
Dim rs As DAO.Recordset
Dim bh
bh = DMax("[产品ID]", "A_CB_001产品主表", "Mid([产品ID], 1, 1) = 1") + 1
Set rs = CurrentDb.OpenRecordset("A_CB_001产品主表")
rs.AddNew
rs("产品ID") = bh
rs("所属客户ID") = Me.所属客户ID
rs("客户代号") = Me.客户代号
rs("档案号") = Me.档案号
'....
rs.Update
rs.Close
Set rs = Nothing
Me.Requery
DoCmd.GoToRecord , , acLast
Exit_Cmd_复制_Click:
Exit Sub
Err_Cmd_复制_Click:
MsgBox Err.Description
Resume Exit_Cmd_复制_Click
End Sub
把'....变为要复制的其他字段和内容,当然还要应用dao |
|