Hi,
I'm producing an app that searches MS Access code modules (forms, reports, modules) and opens a specific module where the search term / word resides.
It works fine if applied to the current database app.
I'm trying to make it more generic so that it can also check a list of other (external) apps.
The problem is, that it opens the external app module ok, but as soon as it exits the local code sub - this closes the external app also.
Any ideas about how to get around this?
The code (which is in a function) is:
As soon as this sub is exited - the external app closes.
Any help / pointers appreciated.
ATB,
Darrylle
Never argue with an idiot, he'll bring you down to his level - then beat you with experience.
I'm producing an app that searches MS Access code modules (forms, reports, modules) and opens a specific module where the search term / word resides.
It works fine if applied to the current database app.
I'm trying to make it more generic so that it can also check a list of other (external) apps.
The problem is, that it opens the external app module ok, but as soon as it exits the local code sub - this closes the external app also.
Any ideas about how to get around this?
The code (which is in a function) is:
Code:
Private Sub Show_Object
Dim dbs As Database
Dim rst As Recordset
Dim strApp As String
Dim appApp As Access.Application
Set appApp = CreateObject("access.application")
strApp = txtApp_Name_Fk 'Get application path / name.
appApp.OpenCurrentDatabase strApp
appApp.Visible = True
If (Left(txtObj_Container, 5) = "Form_") Then
appApp.DoCmd.OpenForm Mid(txtObj_Container, 6), acDesign 'Form.
Else
If (Left(txtObj_Container, 7) = "Report_") Then 'Report.
appApp.DoCmd.OpenReport Mid(txtObj_Container, 8), acDesign
Else
appApp.DoCmd.OpenModule txtObj_Container, acDesign 'Module.
End If
End If
End Sub
As soon as this sub is exited - the external app closes.
Any help / pointers appreciated.
ATB,
Darrylle
Never argue with an idiot, he'll bring you down to his level - then beat you with experience.