I am trying to make the user interface more user-friendly by creating a two


command buttons that will open the dialog box to insert an object into an OLE
field.


Private Sub CmdInserir_Click()
On Error GoTo Err_CmdInserir_Click
DocDigital.SetFocus
DoCmd.RunCommand acCmdInsertObject
Exit_CmdInserir_Click:
Exit Sub
Err_CmdInserir_Click:
DocDigital.SetFocus
'MsgBox "Deverá mencionar o caminho", vbInformation
Resume Exit_CmdInserir_Click
End Sub

Private Sub CmdOrigem_Click()
DocOrigem.SetFocus
DoCmd.RunCommand acCmdInsertObject
Exit_CmdOrigem_Click:
Exit Sub
Err_CmdOrigem_Click:
DocOrigem.SetFocus
'MsgBox "Deverá mencionar o caminho", vbInformation
Resume Exit_CmdOrigem_Click
End Sub


This worked once. Nothing changed but the code won't run anymore. Now, I
get error 2001, "You have cancelled the previous operation"

What did I do wrong? How do I fix it?

Thanks,
Victor Hugo