"AdmSteck" <(E-Mail Removed)> wrote in message
news:2B3A99F9-1695-4AC6-AB2B-(E-Mail Removed)...
> 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?
>
> "Jim Burke in Novi" wrote:
>
>> Check out this example. Even though it's being done in Excel rather than
>> Access in the example, I'm pretty sure the principle should be exactly
>> the
>> same...
>>
>> http://www.mrexcel.com/forum/showthread.php?t=351617
>>
>> "AdmSteck" wrote:
>>
>> > 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.
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.
--
Brendan Reynolds