PC Review


Reply
Thread Tools Rate Thread

Application events

 
 
AdmSteck
Guest
Posts: n/a
 
      20th Feb 2009
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.
 
Reply With Quote
 
 
 
 
Jim Burke in Novi
Guest
Posts: n/a
 
      20th Feb 2009
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.

 
Reply With Quote
 
AdmSteck
Guest
Posts: n/a
 
      23rd Feb 2009
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.

 
Reply With Quote
 
Brendan Reynolds
Guest
Posts: n/a
 
      23rd Feb 2009
"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

 
Reply With Quote
 
AdmSteck
Guest
Posts: n/a
 
      23rd Feb 2009
For some reason I never even thought of using a timer. I guess without
application events that is the next best thing. Thanks!

"Brendan Reynolds" wrote:

> "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
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Application load and application exit events Domac Microsoft Access 1 28th Aug 2006 10:04 AM
some kind of Application Variable with Application Events??? Pieter Microsoft Dot NET Framework 4 22nd Nov 2005 08:10 AM
some kind of Application Variable with Application Events??? Pieter Microsoft Dot NET 4 22nd Nov 2005 08:10 AM
some kind of Application Variable with Application Events??? Pieter Microsoft VB .NET 4 22nd Nov 2005 08:10 AM
Application events =?Utf-8?B?YmVu?= Microsoft Excel Programming 29 21st Jul 2005 04:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:29 PM.