commandbutton click event not trigering

M

Michel

I have a commandbutton on the Read page and coded a
simple msgbox in the click event and nothing happens.

sub commandbutton1()
 
S

Sue Mosher [MVP-Outlook]

Did you publish the form? Where? What's the state of the "Send form
definition..." box on the (Properties) page?
 
M

Michel

Sorry, the message was posted before i finished typing it.

here is the sample code:
Function CommandButton1_Click()
Msgbox "Test"
End Function

The form is published in Personal Form Library for
testing purpose and sent to myself and the send form
definition with item is selected.
 
S

Sue Mosher [MVP-Outlook]

That's the problem. Code doesn't run on one-off forms. Clear the "Send form
definition ..." box and republish.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
M

Michel

I tried removing the send form definition, republished
the form and sent it to myself and the code is still not
executed.
 
S

Sue Mosher [MVP-Outlook]

Are you sure that you're sending the new version? If you incremented the
version number (which you should always do), you'll be able to check on the
Help | About This Form dialog?

Also, a Click event handler should be a Sub not a Function. Did you
double-check that the control name matches the procedure name?
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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