Open form in another database

A

Argyronet

Hi,

Yes, it's possible but what is the reason for what u want to do that.
Do you want to get data from the another DB from this form.
Give me more infos to get an answer...
--
Argy
Goto : http://argyronet.developpez.com/
Livres :
Créez des programmes avec Microsoft Access 2007 (ISBN 2742982442)
VBA pour Office 2007 (ISBN 2742983910)
 
F

fredg

Is there a way to open a form in a database other than the current database?

Yes you can.

Public Sub OpenForeignForm()
Dim appAccess As Access.Application
Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase "C:\MyPath\DataBaseName.mdb"
appAccess.DoCmd.OpenForm "FormName"
Set appAccess = Nothing
End Sub
 
N

Nan Hauser

I have one database that keeps track of procurement and another that keeps
track of milestones for all of my projects. When I get a new project, I want
to update the project specific data in both databases, but I want to do it
using one form in only one of the databases. This data consists of delivery
letter information for the milestone database and proposed purchasing
information in the procurement database. I'd like to update the data from my
procurement database which would require opening the form in the milestone
database to allow entering the delivery letter information. Thanks for
getting back to me.
 
A

Argyronet

Humm, it was what I thought...
Sorry for my UK/US explanations, I'm french
You mustn't open a foreign form because in this way, you will have to
instanciate another instance of Access via OLE and it could be interact with
an not convenient use. The better way I propose to you is to use a Database
Object like :
Dim oDB as DAO.Database
Then you open the target database with OpenDatabase method with the
appropriates paramerters (e.g. password etc... if necessary)
So after, you use a RecordSet to open a table from the DB variable object
(with dbOpenTable option) and then, you will be able to edit ou update
records as you want.
This solution allow you to bind the recordset data to a local form (you have
certainly to build) ; you will have to bind all necessary textboxes and
controls.
In this form, you put a command button to validate or cancel data changes.
The better way is to use transaction mode by using BeginTrans and Commit it
the data have to be updated into differents tables.

Did you understand what I suggested ?
Do you need and example ?

Sorry, I could not reply now because in France, it's late 11:45 pm and I'm
tired so I continue tomorrow if you have further questions.
--
Argy
Goto : http://argyronet.developpez.com/
Livres :
Créez des programmes avec Microsoft Access 2007 (ISBN 2742982442)
VBA pour Office 2007 (ISBN 2742983910)
 

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