473,399 Members | 2,146 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,399 software developers and data experts.

open another database from a form

3
I am trying to figure out how to open one database from another database form. I need to have a central database where I open various others and run macros.
Jul 9 '08 #1
2 6021
PianoMan64
374 Expert 256MB
Is there a particular table with the database that you're wanting to open in the other database?

I need more information and specifications as to what the names of the database, tables, fields you're wanting to access and so on.

Let us know, then we would be able to give you a more specific answer to your question.

Thanks,

Joe P.
Jul 10 '08 #2
ADezii
8,834 Expert 8TB
If you wish to Open a series of External Databases as the Current Database in the Access Window, manipulate them in some manner, then Close each one systematically, you can use some simple Automation code. This is essentially a 3 step process. The OpenCurrentDatabase method enables you to open a Microsoft Access database from another application through Automation in the Access Window.
  1. Declare a Variable as type Access.Application in a Standard Module:
    Expand|Select|Wrap|Line Numbers
    1. Public appAccess As Access.Application
  2. Write code to Open the External Database as the Current Database, and perform some action:
    Expand|Select|Wrap|Line Numbers
    1. 'Initialize string to database path.
    2. Const conDBPath As String = "<Absolute Path to Database>"
    3.  
    4. 'Create new instance of Microsoft Access.
    5. Set appAccess = CreateObject("Access.Application")
    6.  
    7. 'Open database in Microsoft Access window.
    8. appAccess.OpenCurrentDatabase conDBPath
    9.  
    10. 'Run Macro1 in the External DB
    11. appAccess.DoCmd.RunMacro "Macro1"
  3. Close the Instance of the External DB:
    Expand|Select|Wrap|Line Numbers
    1. appAccess.CloseCurrentDatabase
  4. This is just one of several Options.
Jul 10 '08 #3

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

Similar topics

3
by: I Are Confused | last post by:
I am trying to open Database #2 while in Database #1 and delete a table that is in #2 so that I can copy a table from #1 into #2 - all through a function. My Database #2, as part of the start up,...
1
by: bailee220 | last post by:
I have included the following code to open an Access database form from within an exsisting Access database. But when I run the code, it appears that it opens the database because in windows...
2
by: Support4John | last post by:
a2k (9.0.6926) SP-3 Jet 4.0 SP-7 I have a button on a Single Form that when pressed displays all the underlying records in the table in a Datasheet Form. For example, Northwind, Customer...
1
by: bennett | last post by:
I'm trying to write an ASPX page that uses an OleDbDataAdapter to get data from a SQL Server database. When I test the connection, it returns success, and when I preview the data using the...
1
by: kevcar40 | last post by:
HI i have a database that runs autoexec on open the autoexec deletes the current tables and imports updates tables then open the form used for querying the tables this works fine however when a...
5
by: BD | last post by:
I am coding with C# in Visual Studio 2005 for a database application residing on remote MS SQL Server 2005. What I want to do is open the same form but from 2 different places and only one...
5
by: Ian | last post by:
I am trying to: 1. Open a form on the external database 2. Enter a value in a text box on that form I have 1 above working OK using module form “The Access Web”, the module looks like this: ...
1
by: billelev | last post by:
I am able to use the OpenCurrentDatabse method to open a new instance of an existing database and then open a form within that database. However, if the database I am interested in is already open,...
4
by: Martin Bentler | last post by:
I have a form that is locked for editing, adding or deleting. Through the use of a command button I open another form, that allows editing, plus allows the user to other areas of the database,...
5
by: Mai Le | last post by:
Hello Experts. Coul you please help me to fix my program. I created a login from with 2 levels. Admin an User. If Admin login will open A form and If User login will open B form I had table...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.