Q: Is there a way to run an "OnTimer" event without a form?

M

MarkD

Hi All,

I'm using Access 2000. I have an OnTimer event on a form
that allows me to track users on the system.
Unfortunately, this only works for people who load the
form. The form automatically loads on startup, but only
the Data Entry people use the forms; the analysts close
the form so they can get to the data directly.

Is there a way I can load a hidden form on startup? (Say,
for example, a form that doesn't show up, not even in the
explorer bar. )

TY!
-Mark
 
D

Dirk Goldgar

MarkD said:
Hi All,

I'm using Access 2000. I have an OnTimer event on a form
that allows me to track users on the system.
Unfortunately, this only works for people who load the
form. The form automatically loads on startup, but only
the Data Entry people use the forms; the analysts close
the form so they can get to the data directly.

Is there a way I can load a hidden form on startup? (Say,
for example, a form that doesn't show up, not even in the
explorer bar. )

You can't run a Timer event without a form to run it from, but you can
load a hidden form at startup. The easiest way, if you already have a
startup form (maybe a "splash screen"-type form), is to have code in
that form's Open event that opens your hidden form; e.g.,

Private Sub Form_Open(Cancel As Integer)

DoCmd.OpenForm "frmTrackUsers", WindowMode:=acHidden

End Sub

Or you could use an AutoExec macro to open the hidden form.

It's even possible to make the hidden form your application's startup
form, but arranging for it never to show at all on the screen is
trickier than you'd think, so I don't recommend it when the other
alternatives are available.
 
D

david epsom dot com dot au

And note, hidden forms don't show up in the explorer
bar.

(david)
 
Top