Shared Add-In for Access 2007

D

Dan Gheorghe

Hello,
I followed this tutorial :
http://msdn2.microsoft.com/en-us/library/aa902693.aspx
I tried to declare a form variable in c# and hook it up with the form in
access.
first i declared it as null...as same as the others "private Access.Form
Form1 = null;" and then in the hookup function i hooked it up with the form
from access... The problem is that i want to use the keypressed event on the
form
public void HookupControls(
Access.Form form,
Access.TextBoxClass textBox1,
Access.TextBoxClass textBox2,
Access.TextBoxClass textBox3
)
{


Form1 = form;

Form1.KeyPress +=
new Access._FormEvents_KeyPressEventHandler(
SendData2);
Form1.OnKeyPress = "[Event Procedure]";


quantityTextBox = textBox2;

Bar = textBox3;
unitPriceTextBox = textBox1;

}
private void SendData2()
{



// Send the user's text straight out the port
char Cr;
char Lf;
Cr = (char)10;
Lf = (char)13;
comport.WriteLine(Cr + "s" + Lf);



}
The problem is that i get an error at "Form1.KeyPress += new
Access._FormEvents_KeyPressEventHandler(SendData2)
:

No overload for 'SendData2' matches delegate
'Microsoft.Office.Interop.Access._FormEvents_KeyPressEventHandler'
SharedAddIn

I tried to put the Sendata2 with the object sender and KeyEventArgs e
parameters...but nothing.... I found no other tutorials about access shared
add ins..so please hel me
Thank you.
 

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

Similar Threads


Top