Copy form from one db to another?!

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all.

I wish to email updates to an existing db to an office. The updates are in a
new db. When they open the new file it will make a copy the old file and then
send across the updated objects to the old file.

This works fine expect for forms!?

The code below shows how I'm doing this. It work for tables, queries,
reports etc.. but not for forms!

Any help would be welcome.

Thanks

M.


If cntLoop.Name = "Forms" Then
For Each docLoop In cntLoop.Documents
If docLoop.Name <> "frmUpdateDatabaseObjects" Then
DoCmd.CopyObject dbTarget.Name, docLoop.Name, acForm, docLoop.Name
End If
Next docLoop
End If


If cntLoop.Name = "Reports" Then
For Each docLoop In cntLoop.Documents
DoCmd.CopyObject dbTarget.Name, "", acReport, docLoop.Name
Next docLoop
End If


If cntLoop.Name = "Modules" Then
For Each docLoop In cntLoop.Documents
If docLoop.Name <> "Module1" Then
DoCmd.CopyObject dbTarget.Name, "", acModule, docLoop.Name
End If
Next docLoop
End If
 
hi.
When copying to a different database, leave the new name
argument blank to keep the same name.

DoCmd.CopyObject dbTarget.Name, "", acForm, docLoop.Name
 
Back
Top