Application events

A

AdmSteck

Does Access expose any application events like Excel and Word? I want to be
able to tell when a user switches back to Access from another application.
The form.activate method only seems to apply when switching between forms and
not applications. I know in Excel you can use the withevents keyword in a
class module to capture Excel application events like this but I can't find
anything similar in Access. Thanks.
 
A

AdmSteck

Thanks for the reply. I have used withevents in Excel before. The problem I
am having is that it doesn't seem that Access exposes the Application object
or any events. I have a button on a form opens a directory to allow
attachments to a record. I am trying to put a count of files in the button
caption and the only events I have to run the code to count the files is the
form_current event. I would like to refresh the button caption when the
Access application regains focus from the explorer window. Is there any way
to get an Application_Activate event in Access or does this only exist in
Word and Excel?
 
B

Brendan Reynolds

AdmSteck said:
Thanks for the reply. I have used withevents in Excel before. The
problem I
am having is that it doesn't seem that Access exposes the Application
object
or any events. I have a button on a form opens a directory to allow
attachments to a record. I am trying to put a count of files in the
button
caption and the only events I have to run the code to count the files is
the
form_current event. I would like to refresh the button caption when the
Access application regains focus from the explorer window. Is there any
way
to get an Application_Activate event in Access or does this only exist in
Word and Excel?


Access does expose an Application object, but that object does not expose
any events, only methods and properties.

You say that you're opening a a directory to allow attachments to a record.
Are these attachments being added programmatically? If so, perhaps you could
refresh the caption at the end of the code that adds the attachments?

Alternatively, you could consider using the form's Timer event to
periodically refresh the caption.
 
A

AdmSteck

For some reason I never even thought of using a timer. I guess without
application events that is the next best thing. Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top