Tony,
>This code seems to work fine. So why is the other code not working?
>
>Maybe I'm not calling the code behind the button correctly? Any ideas?
Hmmm...this should "just work". I tried this on the sample application Customer Orders Form. I dropped an mmButton on the Properties tab, created a handler for the new button's Click() event and added code to this code to the handler and it worked like a charm:
Me.btnSave.PerformClick()
Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com