Run procedure any time ANY Form is opened?

Meltdown

Registered User.
Local time
Today, 02:18
Joined
Feb 25, 2002
Messages
472
I have an old database I need to clean up and I want to see what Forms are still being actively used. So, I'm going to create a log table and, if a Form is opened, log that event.

I could write a public procedure -- open every Form and call the procedure in the OnOpen() event -- but, I was wondering if there is a way to capture Forms that are opened without hard-coding into each Form?

Regards
Melt
 
have a pop up form with timer event and open it hidden. you can do this through autoexec macro.

put this code on the Timer procedure:

private sub Form_Timer()

dim objAccess as AccessObject

For each objAccess In CurrentProject.AllForms
If objAccess.IsLoaded Then
If objAccesst.CurrentView <> acCurViewDesign And objAccess.Name <> Me.Name Then
' the form is loaded
' your code goes here to save, the name of the form is in objAccess.Name
End If
End If
Next
Set objAccess = Nothing
End sub
 
Thanks a lot arnelgp, that'll work.

Reagrds
Melt
 

Users who are viewing this thread

Back
Top Bottom