Click a button on an MS Access form from C# using Access Interop

Posted by Az on Stack Overflow See other posts from Stack Overflow or by Az
Published on 2010-04-07T11:39:15Z Indexed on 2010/04/07 11:43 UTC
Read the original article Hit count: 227

Filed under:
|

Hi, I can connect to the access database and run functions etc from c#, I can even get a hold of the button I need to click, but I can't make it think it's been clicked.

 nonManagedDb.DoCmd.OpenForm("frmMaintenance", Access.AcFormView.acNormal, MissingVal, Access.AcFormOpenDataMode.acFormReadOnly, Access.AcWindowMode.acWindowNormal, MissingVal);
            var RunRep = (CommandButton)nonManagedDb.Forms["frmMaintenance"].Controls["btnDailySheetsReport"];

That's as afar as I've gotten with this, I've tried reflection to grab it's event and invoke it but it's classed as a COM object only so that's out.

© Stack Overflow or respective owner

Related posts about c#

Related posts about ms-access