What do the events Form_CommandExecute, CommandChecked, CommandBeforeExecute etc actually DO? (1 Viewer)

Notiophilus

Registered User.
Local time
Today, 19:14
Joined
Jan 18, 2015
Messages
42
Access 2010. Trying to understand more about event order on forms, I ran into the Form events CommandBeforeExecute, CommandChecked, CommandEnabled, and CommandExecute. They look intriguing and possibly useful, but what do they actually do, and what triggers them? According to Microsoft's help page for CommandExecute, for example, the event...
Occurs after the specified command is executed. Use this event when you want to execute a set of commands after a particular command is executed.
It then gives the following example:
Code:
Private Sub Form_CommandExecute(ByVal Command As Variant)
    MsgBox "The command specified by " & Command.Name & " has been executed."
End Sub

...so what counts as a command in this case? The help page references "Microsoft Office web components" so I'm assuming it might have something to do with web-based Access databases (?) which I know nothing about. Nonetheless, I'm curious.

(sorry for the post spam - it's one of those days.)
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 13:14
Joined
Feb 19, 2002
Messages
43,227
If the event is related to web processing, you won't be able to use it and since the web feature has been deprecated, you are just wasting your time because you'll never be able to use it.

If you want to cycle through form events, create a bound form with at least two bound controls controls. Then put message boxes in all the form/control events you want to check.

Msgbox "Form BeforeUpdate", vbOKOnly
Debug.Print "Form BeforeUpdate"

You can expand your esploration and include a bound subform as well. Might as well make the subform continuous.

That way you get popups and you also get a trail. You will also notice that control level events don't ever run unless the control gets the focus.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 12:14
Joined
Feb 28, 2001
Messages
27,146
I have never seen those events. When I followed the link, it points out that there is an add-in involved. There was a time when Access forms could be placed on-line as a web-enabled utility. However, the web features were found to be less than ideal and were eventually revoked. There is an Outlook add-in called OWA (Office Web Apps) and this might relate to driving that functionality from VBA.

Perhaps if you research Microsoft OWA, you would be able to dredge up something. But I don't even remember seeing those events the last time I was working on form-related event sequencing.
 

Notiophilus

Registered User.
Local time
Today, 19:14
Joined
Jan 18, 2015
Messages
42
since the web feature has been deprecated, you are just wasting your time because you'll never be able to use it
Hm, that makes sense - some of the links I found were for Access 2003, so ¯\_(ツ)_/¯
Thank you both for indulging my curiosity!
 

sonic8

AWF VIP
Local time
Today, 19:14
Joined
Oct 27, 2015
Messages
998
Access 2010. Trying to understand more about event order on forms, I ran into the Form events CommandBeforeExecute, CommandChecked, CommandEnabled, and CommandExecute.
[...]
...so what counts as a command in this case? The help page references "Microsoft Office web components" so I'm assuming it might have something to do with web-based Access databases (?) which I know nothing about.
These events are relevant for the PivotTable- and PivotChart-View of Access forms, which are available in Access 2007 and 2010.
Some of their functionality is implemented in the Office Web Components (OWC) library. - Despite the name, this has nothing to do with the ill-fated Access Web Apps.
The Pivot-Views and OWC were deprecated and removed with Office/Access 2013. Most of the original documentation is not available anymore, so my text on the PivotChart-View might be one of best remaining public resources on that functionality. As you've got Access 2010 installed, you might find more complete information in the local help file for Access 2010.

Even though other people here got the context wrong, their conclusion to leave this deprecated functionality alone is absolutely correct.

OWA, originally "Outlook Web Access" meanwhile renamed to "Outlook Web App", is something entirely different. OWA is simply the web site were you access your emails either in your on-prem Exchange Server or hosted by Microsoft in the cloud.
 
Last edited:

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 12:14
Joined
Feb 28, 2001
Messages
27,146
Thanks for the clarification, @sonic8 - glad SOMEONE here remembered this better than my old memory.
 

Users who are viewing this thread

Top Bottom