473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

DoCmd.CopyObject for acform doesn't work

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
0 1282

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

Similar topics

3
by: user_5701 | last post by:
Hello, I'm getting an error with a Docmd.Transferspreadsheet line of code: DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel2000, "tblTest", pathAndFilename, True The above line...
2
by: Bill Stock | last post by:
I've been renaming the ALL high level objects in a database and searching out the dependent objects to change the references. This was all going fairly well, until DoCmd.Rename stopped working on...
15
by: Thelma Lubkin | last post by:
formA determines some_where and some_value and issues docmd.close ,Me docmd.openform "formB", , ,some_where, , ,some_value formB receives the correct some_where and some_value After...
2
by: Mike | last post by:
I am trying to open a search results form based on the input from a prompt form. I am using the following code: --- Begin Code --- Private Sub btnSearch_Click() 'Dim Variable and assign data...
2
by: Wayne | last post by:
I've noticed a behaviour in A2007 that doesn't appear in A2003. The problem is appearing in a native A2007 database and an A2003 database running in A2007. If I press a command button to delete a...
2
by: rando1000 | last post by:
Okay, can I use this command to copy a form from another database to the currentdb? I'm trying to create an "update" button that deletes the current form in the user's database and copies the newest...
6
by: RZ15 | last post by:
Hi, I frequently have code in my forms that will turn warnings off, run make table queries, then turn warnings back on using the following code: DoCmd.SetWarnings WarningsOff DoCmd.OpenQuery...
5
by: scottbouley | last post by:
Maybe I'm missing something or perhaps there's another way to do this. I'm trying to allow the user to preview and print an invoice as they are exiting from the New Sale form. However, the preview...
2
by: Dan2kx | last post by:
Hi gang, i have yet another curious question for the panel... i have a userform that seems to be disobeying the docmd.close acform, "FormName" i give it, either on a button or in a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.