how to use a form of another db

jriano

Registered User.
Local time
Yesterday, 22:18
Joined
Dec 9, 2003
Messages
45
I have several databases, and a couple of tables are linked from one db to another. The thing is from db A, I would like to also use a couple of forms of dbB. This is because in order to create a complete record in db A I need first to enter some data in db B. So i figured I would call from THIS form THAT Form, filled the data in THAT form, close it and continue filling the rest of the needed data in THIS form.
How it is being done right now, is we go to db B, open THAT form, fill data. Then we go to db A , open THIS form and complete the record.
I want to be able to call THAT form from THIS form (being those two forms in different db)
Can I open a form from another db? how? I dont want to link tables, having different db is a need.
Thank you
 
I think that the key to doing what you want is to set a reference to the "other" database. There are more details and sorry I don't know them, but hopefully that will give you a step in the right direction. You might search on something like "custom library databases" -- I know I came across an article a while back that said you could create standard forms in a library database that could then be opened and shared by your other databases.

Hope this helps. If you figure out the details, please let me know.
 
thank you, I'll look into it
 
OK, I found the article on doing this...it's in the March 2003 issue of Access VB/SQL Advisor.
Lets say you're in MyDb.mdb and want to open form X in library.mdb. Basically all you do is:

1. In MyDB.mdb, set a reference to the library.mdb
2. In library.mdb, add a public sub :

public sub OpenFormX()
docmd.openform "frmX"
end sub

3. Now you should be able to open form X from MyDB by running OpenFormX.

It sounds easy.... let me know how it works!
 
DataMiner, could you tell me how to set a reference? I don't know how to do it, I searched and found nothing specific.
Thanks
 
1. Open any module
2. On the Tools menu, select References
3. Browse to select your library database.
 
Jumping in here to suggest something... I've never opened a form from a different database, but this link may help. A possible work around involves linking the table. Your statement "I dont want to link tables, having different db is a need" doesn't necessarily compute. You can still have two separate databases, but the "linking" just allows you access to the data structure and data of the linked table. Then, all you have to do is import the required form from the one database to the other. Not sure if I'm clear here, but it seems a more reasonable approach.

HTH,
Jeff
 

Users who are viewing this thread

Back
Top Bottom