By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 921 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

DoCmd.CopyObject for acform doesn't work

P: 1
I have been tring to copy forms from the current db my code is in to an new mdb I have created in the same subroutine. I closed the new mdb file so it shows being there and when I run the code I get back a message that the form "Main" already exits in the open database. The command I am running looks like the following:
DoCmd.CopyObject LFilename,,acForm,"Main"

This form exists in the current mdb file but not in the new one I created. This statement will work if I rename the form like this:
DoCmd.CopyObject LFilename,"Main1",acForm,"Main"

I don't want to do that since the code will not work then because form names are used in the code. Everything I have found says to leave the [New name] blank to use the same name as the source object. This code works for acTable and acQuery but I can't get it to work for acForm. Any help would be appreciated. Thanks
Sep 20 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.