Windows Develop Bookmark and Share   
 index > Windows Forms General > Interact with Windows forms (.net 2.0) from Access 2003
 

Interact with Windows forms (.net 2.0) from Access 2003

I need some direction here. Can someone give me a few pointers in the direction I need to go with this?

I have a very large Access Project (adp) that we are retaining. I am now in the process of creating a new Windows Forms app (vb.net in vs 2005). These applications must interact.

I have been able to control the Access application from my Win Form. NowI need to be able to do the opposite. The access app is a work order system, and the Win Form app will be our new customer/contact management system. In the contact system, I can have multiple copies running.

From within Access, I need to be able to determine, which contact window is the topmost window, and be able to get information from it that the Access app needs. Also, I need to be able to click a button on our Work order form in access, and have the Contact form change to the corresponding contact. I am assuming I need to use COM for this and am trying to research.

The main thing I am running up against now (and I am it is easy and that I am just missing something obvious!!) is:

If I have a com object that Access can connect to -in that com object, how do I find the running Windows form that is the topmost?

I think that once I can get the com object to connect to the form everything should be relatively easy.

Thanks,
J. Clay

J. Clay  Thursday, March 16, 2006 12:42 AM

If you implement your COM object within your WinForms app using a technique like one of the following:

http://codebetter.com/blogs/peter.van.ooijen/archive/2005/06/03/64041.aspx

http://west-wind.com/weblog/posts/705.aspx

then it should be relatively easy to get the active contact form within that app using Form.ActiveForm

I've never done it myself so I don't know how well that works.

If you don't want to do that, then maybe look at the Win32 API EnumWindows and ID your active contact window in the callback passed to that function.

DCMonkey  Thursday, March 16, 2006 6:31 AM

If you implement your COM object within your WinForms app using a technique like one of the following:

http://codebetter.com/blogs/peter.van.ooijen/archive/2005/06/03/64041.aspx

http://west-wind.com/weblog/posts/705.aspx

then it should be relatively easy to get the active contact form within that app using Form.ActiveForm

I've never done it myself so I don't know how well that works.

If you don't want to do that, then maybe look at the Win32 API EnumWindows and ID your active contact window in the callback passed to that function.

DCMonkey  Thursday, March 16, 2006 6:31 AM

Thanks DCMonkey!  There is a lot if info there, but I think you may have pointed me in the right direction.  It will take me a while to go through and see if I can make it work.

Jim

J. Clay  Thursday, March 16, 2006 4:44 PM

You can use google to search for other answers

Custom Search

More Threads

• How to give permissions for an assembly?
• sending Cookies from a Web Client
• Image on button with FlatStyle.System
• Retrieve File name using - Open ---> With ---> Program
• disabling horizontal form resizing
• Controlling process of multiple application instances of same app
• Control placement when Inheriting forms BUG??
• Changing Tooltip text
• Formatting a string for an IP Address.
• numericUpDown ValueChanged