Im trying to replace a form from a database to another with this:

Dim accObj As New Access.Application
Set accObj = CreateObject(dir)

accObj.DoCmd.DeleteObject acForm, "Formulario"

DoCmd.CopyObject dir, "Formulario", acForm, "Formulario"

But I get an error of file access in last line.

I`m working in Access2000

Whats what Im doing wrong??