Object invalid or no longer set on CopyObject method
- From: "tig" <nbr17fan69@xxxxxxxxx>
- Date: 18 Jan 2007 12:52:26 -0800
I thought you could use the CopyObject method on anything but modules,
but I continue to get this error when looping though my dbs. I've
tried TransferDatabase and get the same result
Any ideas?
TIA
Here's my code:
Sub copy_forms()
Dim x
Dim dbnames(1 To 9) As String
dbnames(1) = "C:\db1.mdb"
dbnames(2) = "C:\db2.mdb"
dbnames(3) = "C:\db3.mdb"
dbnames(4) = "C:\db4.mdb"
dbnames(5) = "C:\db5.mdb"
dbnames(6) = "C:\db6.mdb"
dbnames(7) = "C:\db7.mdb"
dbnames(8) = "C:\db8.mdb"
dbnames(9) = "C:\db9.mdb"
For Each x In dbnames
DoCmd.CopyObject x, "Main", acForm, "Main"
'DoCmd.TransferDatabase acExport, "Microsoft Access", x, acForm,
"Main", "Main"
Next
Close
MsgBox "Form Copies Complete"
End Sub
.
- Follow-Ups:
- Re: Object invalid or no longer set on CopyObject method
- From: Stefan Hoffmann
- Re: Object invalid or no longer set on CopyObject method
- Prev by Date: Re: Self closing DB
- Next by Date: No duplicates
- Previous by thread: Re: Open Access automatically
- Next by thread: Re: Object invalid or no longer set on CopyObject method
- Index(es):
Relevant Pages
|