home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Ask a Tech Support Question (free)!

copying object in Access with VBA

Reply
Get bargains at  »  Dealighted.com
 
Thread Tools Search this Thread
Currently Active Users: 2179
Discussions: 200,972, Posts: 2,379,771, Members: 246,336
Old July 19th, 2006, 12:37 PM   Digg it!   #1 (permalink)
Member
 
Join Date: Jul 2002
Location: DC Suburbia
Posts: 190
Send a message via AIM to jon112981 Send a message via Yahoo to jon112981
copying object in Access with VBA

I am having some trouble copying an object (specifically a form) from one mdb file to another using VBA code. Here is a brief description of the Access error I am getting:



I have a couple lines of VBA code to copy some forms, tables, reports and queries from one database object to another. The following is a snippet of the code I am using I am using

(note: path is a variant representing the path to the new database)



'Forms

DoCmd.CopyObject path, "frmAdd", acForm, "frmAdd"

DoCmd.CopyObject path, "frmSSAResults", acForm, "frmSSAResults"

DoCmd.CopyObject path, "sfrPrevious", acForm, "sfrPrevious"

'querries

DoCmd.CopyObject path, "qryFIPSCat", acQuery, "qryFIPSCat"

DoCmd.CopyObject path, "FIPSQuestionnaire", acQuery, "FIPSQuestionnaire"

'reports

DoCmd.CopyObject path, "rptFIPSCat", acReport, "rptFIPSCat"

'tables

DoCmd.CopyObject path, "tblVersionNumber", acTable, "tblVersionNumber"

DoCmd.CopyObject path, "tblListOfSystems", acTable, "tblListOfSystems"



When I execute the code with the path as a blank database it works fine. When I use the file that I currently wish to put these objects in I get some errors for the forms only. It works fine if I comment out the lines regarding the copying of forms. I have seen the following error messages:



Error number Description

3011 The Microsoft Jet database engine could not find the object ‘DigSig’. Make sure the object exists and that you spell its name and the path name correctly.

3011 The Microsoft Jet database engine could not find the object ‘Attributes’. Make sure the object exists and that you spell its name and the path name correctly.

2102 The form name ‘|’ is misspelled or refers to a form that doesn’t exist.
jon112981 is offline   Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads
Thread Thread Starter Forum Replies Last Post
Access VBA - Don't want form to close if null MushMouse Technical Support 4 August 11th, 2009 10:43 AM
MS Access 2000 - Name conflicts with existing module, project or object library rbjeep4x4 Applications and Operating Systems 1 August 10th, 2005 10:21 AM
Extand and access the internat Microsoft Office object structure gicio Webmastering and Programming 4 September 9th, 2003 12:44 AM
(c0ders) VBA & Access to VBA & MySQL Whir Webmastering and Programming 5 June 6th, 2002 10:58 PM
Passing a class object variable to another object variable ILC Webmastering and Programming 1 March 1st, 2002 02:10 AM


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Most Active Discussions
Charges against non-tippers dropped.. (6)
Is It Just Me? (3055)
The disrespect of Obama by Russian .. (48)
Delete an OS (16)
Nvidia GTX 260 problem (8)
Laptop with wireless problem. (12)
Wireless Televisions. (12)
CPU fan stops spinning randomly (11)
windows vista security holes (17)
Regular Build (11)
windows 7 problem (7)
Internet Lost (5)
Point and Shoot Camera Suggestions. (6)
Print spooler problem (16)
Recent Discussions
Delete an OS (16)
Multiple Restarts Required at Boot (4)
cell phone won't work (0)
Nvidia GTX 260 problem (8)
Is the PSU I received dead? (15)
Can't open Word (12)
[F@H SPAM 11/16/09] ! 1/2 months to r.. (37)
Steam ID's, Gamertags etc... (4)
Games, Cables, PCI cards, and more fo.. (6)
Dept. of HS: NSA 'Helped' Develop Vis.. (17)
Linksys WMP54GS wireless card problem.. (5)
windows vista security holes (17)
Help getting around port 80 for camer.. (5)
Skillsoft Network+ Study Software Que.. (10)
Browsers wont load websites (3)
help me pls laptop just stopped worki.. (0)
Open With ..... Win7 (3)
Laptop with wireless problem. (12)
Internet Lost (5)
virus blocking exe. files (1)
Point and Shoot Camera Suggestions. (6)
CPU fan stops spinning randomly (11)
Modern Warfare 2: Who Bought It? (65)
Print spooler problem (16)
Kingston Bluetooth Dongle Driver (1)


All times are GMT -4. The time now is 10:38 PM.
TechIMO Copyright 2009 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28