Getting Outlook VBA Command Buttons to work

I'm creating the VB macro and form shown in the attachment. I've create 2 button. Now I want the buttons to *do* something. In VB/Access the button properties dialog had an 'Events' tab with events like 'On Click' which is where one could enter the action code. I see no such mechanism in Outlook on the CommandButton properties. How do I do this?
vbButton.jpg
LVL 1
MarkAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

FarWestCommented:
select the object name in "1" then the event in 2 (click or double click)
ee-code.jpg
0
MarkAuthor Commented:
FarWest: That simply selects the Sub I created, but doesn't appear to connect it to the button. If I remove my CommandButtonRed_click() function, there is nothing in (2) except the name of the main function.

Running the module (F5) and clicking on the "Red Category" button does nothing -- does not execute my CommandButtonRed_click() function (which I've changed to a Msgbox())

Simply creating the <buttoName>_Click() function apparently is not enough to fire the event when the button is clicked. How do I do this? Why is there no onClick property in the button object properties list (rhetorical question)?
0
FarWestCommented:
here is a sample from my outlook 2010, no code for forms , blank  click event code was initialized when double click the button, when selecting events all available events are displayed in drop down
ee-code2.jpg
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

FarWestCommented:
did you tried to remove the button and add it again?
0
MarkAuthor Commented:
Ah Ha!!! Thank you, thank you! I cannot put the event code in the module with the [form].Show function. I have to right click on Forms > MyFormName and select 'View Code'. That gives me the view shown in your image. All my command buttons are shown in the left drop-down, and all the associated events are shown in the right drop down. When I put my MsgBox("red") line in there, it works!!! Sheesh! This is nothing like the VB/Access development studio!!!
0
MarkAuthor Commented:
One last thing and I'll close out this question. Just to confirm: is "Unload Me" the correct way to close a form?
0
FarWestCommented:
I think unload me is fine
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VB Script

From novice to tech pro — start learning today.