Reputation: 10156
I have many slave DBs which gets queried by a master DB. I'd like to be able to monitor and quickly access the slave DBs, with their forms and all, from within a form of the master DB.
I was hoping that I could simply create a tab control on a form in the master DB, with each slave DB's MS Access window embedded into each page of that tab.
Is this possible?
Upvotes: 0
Views: 57
Reputation: 81
You cannot insert an application window inside of a subform. To use forms of other dbs you can create a standard module there and insert a public function which returns a form object. So if you have a form "frmTest" in the slave db which you directly want to open in the master db you can write a public function like this:
Public Function GetFrmTest1() As Form_frmTest
Set GetFrmTest1 = New Form_frmTest
End Function
This method works only if you have code in the module, if that's not the case you can use the generic "Access.Form" as type instead of "Form_frmTest".
In the master db you can open this form now. To do that, you can open the reference window in the VBA editor and click "Browse", then search the location of the slave db and add it as reference.
In the master db you can now open it with:
Dim frm As Access.Form ' Here you can only use the generic Form object
Set frm = GetFrmTest1
frm.Visible = True
This will open the external form in your master db. But of course you need a function to return the form object to the master database in any slave db. You can also return any form with one function like this:
Public Function GetForm(strFormName As String) As Access.Form
Select Case strFormName
Case "frmTest1"
Set GetForm = Form_frmTest1
Case "frmTest2"
Set GetForm = Form_frmTest2
...
End Select
End Function
As a result you can use the forms of each slave db in the master db but you must do the navigation on your own.
Another possibility would be to create new forms in the master db and only add linked tables to the slave dbs so you only monitor some data. The advantage here is that you can decide on your own what you want to do when the data is displayed - the other solution would mean you open the form with all it's "home functionality" in the slave db without control over the contents.
Upvotes: 0
Reputation: 4564
You will have to devise some way of creating a form that shows what you are interested in and connecting an instance of the form to each Slave DB and put that on each tab.
Upvotes: 1