Put a form from another database as a subform

M

Michelle

Hello,

I have two databases:

Database A - I want to link to a form here
Database B - I want a subform in database B that links/displays the
form in database A, this way I can put a button on my form to close
and return to Database B.

I was able to create the connection to database A by using:

Dim objACC As New Access.Application
Set objACC = GetObject("\\170.88.217.115\Reporting\Autobot
\Autobot_Master.mdb") 'open first database
objACC.DoCmd.OpenForm ("Report_Generation_Form")

I would rather just put the form on a subform in my current database.

I know this sounds confusing. . . but any help would be great!
 
B

Bob Hairgrove

Hello,

I have two databases:

Database A - I want to link to a form here
Database B - I want a subform in database B that links/displays the
form in database A, this way I can put a button on my form to close
and return to Database B.

I was able to create the connection to database A by using:

Dim objACC As New Access.Application
Set objACC = GetObject("\\170.88.217.115\Reporting\Autobot
\Autobot_Master.mdb") 'open first database
objACC.DoCmd.OpenForm ("Report_Generation_Form")

I would rather just put the form on a subform in my current database.

I know this sounds confusing. . . but any help would be great!

Even if this were possible, it would be terribly inefficient running overthe
network like this.

In general, never try running an Access application (i.e. a .mdb file containing
forms, queries, reports and VBA modules) from over the network; each client
should have their own COPY of that .mdb file (the "front end", which should
contain no [shared] data at all), and the data (i.e. tables and relationships)
should reside in a single, different .mdb file (the "back end") from which you
link the tables into each front end.

Then you can always just import the form into your existing front ends, adjust
the recordset property to point to the correct data, set it up as a subform, and
away you go! Judging from the name of the form, you might also need to import
some reports ... but these should reside on the front end, too.

The reason for this is because Access always runs on the client; there isnever
any remote "server" running for an Access database. MDB files on a network are
just files, nothing else. The executable is always running on the client,so it
is much better if you have the data separated from the rest of the application.
 
J

John W. Vinson

Hello,

I have two databases:

Database A - I want to link to a form here
Database B - I want a subform in database B that links/displays the
form in database A, this way I can put a button on my form to close
and return to Database B.

I was able to create the connection to database A by using:

Dim objACC As New Access.Application
Set objACC = GetObject("\\170.88.217.115\Reporting\Autobot
\Autobot_Master.mdb") 'open first database
objACC.DoCmd.OpenForm ("Report_Generation_Form")

I would rather just put the form on a subform in my current database.

I know this sounds confusing. . . but any help would be great!

It is confusing. Forms DON'T contain data. They're just windows onto data; you
can link to data, but you cannot "link" to a Form.

Just import the form from Database B into Database A; make it a subform; and
set its Recordsource to a linked table pulling the information that you want
to see from the table in Database B (or maybe it's linked from Database C, I
don't know!)

John W. Vinson [MVP]
 
J

John W. Vinson

Relax. . . It was a question, I guess I didn't ask it as good as you
would have. Thanks for your time. Next time don't answer the
question.

My apologies, Michelle. I still don't understand the question. I'll try to
brush up on my telepathy should I see any more such questions from you; or do
as you suggest and not answer.

I hope you were able to resolve your problem.

John W. Vinson [MVP]
 

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