commandbutton click event not trigering

  • Thread starter Thread starter Michel
  • Start date Start date
M

Michel

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

sub commandbutton1()
 
Did you publish the form? Where? What's the state of the "Send form
definition..." box on the (Properties) page?
 
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.
 
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
 
I tried removing the send form definition, republished
the form and sent it to myself and the code is still not
executed.
 
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
 
Back
Top