Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a form from a different access database

Status
Not open for further replies.

shep6

Programmer
May 4, 2001
38
0
0
GB
Hi there

Can anyone help me out the the code needed for when the user clicks a command button within a form on database1, it opens up a form on database2. Both databases are held within the same path/directory. I have managed to open database2 using:

Dim wsp As Workspace
Dim dbs2 As Database

Set wsp = DBEngine.Workspaces(0)

Call GetDatabasePath
Set dbs2 = wsp.OpenDatabase(strDatabasePath & "databasename.mdb")

but I can't work out how to open a form from dbs2, maybe I am going down the wrong route?

any help would be appreciated.

thanks
 
I'm not sure exactly what you are tyring to accomplish, but without any research, I don't think you can do that.

I would create a link from the first database to the table(s) contained in the form in the second database and then import the form from the second database into the first database. You can then redesign the imported form to work with data in the linked table.

Anything you do on this form will update the table is the second database.

No need for messy coding then.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top