Hello ,I have a table in a database with quite similar records , and a few changes in each new record.
So I need a code that duplicate the last record from a form and open another form to modified this record.
I used this two codes each one in a different command button and it works, but not if I tried it togheter in the same command button.
Is it possible to make a command button with this two actions?
Thank you very much!
So I need a code that duplicate the last record from a form and open another form to modified this record.
I used this two codes each one in a different command button and it works, but not if I tried it togheter in the same command button.
Is it possible to make a command button with this two actions?
Thank you very much!
Code:
Private Sub Comando351_Click()
On Error GoTo Err_Comando351_Click
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdCopy
DoCmd.RunCommand acCmdRecordsGoToNew
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand acCmdPaste
Exit_Comando351_Click:
Exit Sub
Err_Comando351_Click:
MsgBox Err.Description
Resume Exit_Comando351_Click
End Sub
___________________________________________________________
Private Sub Comando349_Click()
On Error GoTo Comando349_Click_Err
DoCmd.OpenForm "Indicaciones para red4", acNormal, "", "", , acNormal
Comando349_Click_Exit:
Exit Sub
Comando349_Click_Err:
MsgBox Error$
Resume Comando349_Click_Exit
End Sub
Last edited by a moderator: