PC Review


Reply
Thread Tools Rate Thread

Access 2003 and/or 2007 copy in objects from another mdb

 
 
Matthews_416
Guest
Posts: n/a
 
      25th Mar 2010
Is is possible to write code in an Access MDB that will allow a user to
select another Access MDB and then see a list of report and/or queries so
they can select from the list. Then programatically copy in those objects
from another mdb in to the current mdb? I know that access allows for the
exporting and importing of objects but I have a need to do this
programatically.
 
Reply With Quote
 
 
 
 
Roger Carlson
Guest
Posts: n/a
 
      25th Mar 2010
Sure, it can be done. Here are the general outlines:

1) Use the Open/Save API that you can find here:
http://www.mvps.org/access/api/api0001.htm to select the database file you
want to inspect.
2) Programmatically link the MSysObjects table from that selected database
(it's hidden and system, but it's there) into your database.
3) Create a query based on this linked table that displays the Name and Type
field. Filter the query for types: -32764 and -32768, like this:

SELECT DISTINCTROW Mid([Name],4) AS Expr1, MSysObjects.Type
FROM MSysObjectsRemote
WHERE Type=-32764 OR Type =-32768
ORDER BY MSysObjects.Name;

4) Use this query as the Row Source for a Multi-select Listbox on a form.
5) In code:
a) Step through the seleted values of the listbox
b) Use the "DoCmd.TransferDatabase acImport..." method to copy the
select reports and queries to your database.

On my website (www.rogersaccesslibrary.com), there are several small sample
database which illustrate portions of these:

ChooseReportFromList2-2k.mdb
MultiSelectListboxes2k.mdb
LinkTables2k.mdb

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/...UBED1=ACCESS-L



"Matthews_416" <(E-Mail Removed)> wrote in message
news:55C43E0E-C470-4E63-A16E-(E-Mail Removed)...
> Is is possible to write code in an Access MDB that will allow a user to
> select another Access MDB and then see a list of report and/or queries so
> they can select from the list. Then programatically copy in those objects
> from another mdb in to the current mdb? I know that access allows for the
> exporting and importing of objects but I have a need to do this
> programatically.



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HIDDEN OBJECTS IN ACCESS 2007 Deb Maier Microsoft Access 2 19th Jan 2008 11:43 PM
Access 2007 Ole Objects vs Pictures Cat Microsoft Access 5 19th Dec 2007 12:30 PM
Access 2007 - Objects linked together =?Utf-8?B?YXJ2aW55bFBF?= Microsoft Access Forms 2 9th Aug 2007 06:16 PM
Excel 2007 - Row 1 graphic objects get included when only copy row =?Utf-8?B?RW1lcnlO?= Microsoft Excel Crashes 0 25th Nov 2006 02:00 PM
Copy access objects (reports, queries, etc) from one Access db to another using VB.net kenbeard Microsoft Dot NET Framework 7 16th Feb 2004 04:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:35 PM.