Access 2003 Visual Basic CopyObject

  • Thread starter fmc via AccessMonster.com
  • Start date
F

fmc via AccessMonster.com

When I use CopyObject to copy a form, the associated vb code does not get
copied with the form:

DoCmd.CopyObject , "myform2", acForm, "myform1"

The form looks fine after the copy but no code is present. Any suggestions
would be greatly appreciated.
 
A

Allen Browne

CopyObject works fine here. This might indicate a corruption in your
dababase.

Try this:

1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

2. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact

3. Close Access. Make a backup copy of the file. Decompile the database by
entering something like this at the command prompt while Access is not
running. It is all one line, and include the quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"

4. Open Access, and compact again.

Works now?

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 
F

fmc via AccessMonster.com

THANK YOU!! IT WORKS!

I tried it after completing step 1 of your instructions. The form and code
was copied perfectly. Words cannot express my gratitude for your expert
assistance.

Thanks again,

fred
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top