-
I am making a vb6 front end (menu) to several access97 programs (.mdb with startup form). The problem is i need the vb code to suspend execution until the user closes access.
The Set appObj = GetObject(, "Access.Application") to check if it's running doesn't seem to work cause i think the reference it's returning won't let the user shut access down.
The Detect MS Office tip will let me see if access is running or not, but doesn't seem to let the user close it either.
Any help would be Greatly appreciated!
-Marti
-
are you by anychace letting your app go into a loop checking if the apps running with the Detect MS Office Tip of which you speak(I havn't seen it) does your code look something like this
Code:
Private Function DetectAccess() as Boolean
'returns True If access is running
End Function
Private Sub WaitForAccessToFinish
Do While DetectAccess
Loop
End Sub
if so add a doevents line to your loop so it looks like this
Code:
Private Function DetectAccess() as Boolean
'returns True If access is running
End Function
Private Sub WaitForAccessToFinish
Do While DetectAccess
DoEvents
Loop
End Sub
Hope this helps.
-
The 'Set appObj = nothing' is in hopes of releasing the reference to access (in DetectAccess 'Set appObj = GetObject(, "Access.Application")'). If GetObject returns err = 0 the reference to the object was retrieved - access is alive.
That was my test if the user had closed it yet.
The 'Count(5)' just goes and counts 5 seconds before returning. Which also has a doevents in the middle of that loop 'cause I'm thinking it's during one of the doevents that access will be closed?