Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Access
3rdpartyusrgrp
access
activexcontrol
adp.sqlserver
commandbarsui
conversion
dataaccess.pages
developers.toolkitode
devtoolkits
externaldata
forms
formscoding
gettingstarted
internet
interopoledde
macros
modulescoding
modulesdaovba
modulesdaovba.ado
multiuser
odbcclientsvr
queries
replication
reports
security
setupconfig
tablesdbdesign
  
 
date: Sat, 4 Feb 2006 12:58:59 -0800,    group: microsoft.public.access.interopoledde        back       


Can't Sink Access Events in Vb.NET   
I am trying to sink an Access.CommandButton Click Event in Vb.NET. I have 
tried about every technique unsuccessfully. I get the following error:

An unhandled exception of type 'System.Runtime.InteropServices.COMException' 
occurred in interop.access.dll
Additional information: Exception from HRESULT: 0x80040202.

My code is as follows:

Friend Class clsMain
    Private oAccApp As New Access.Application
    Private WithEvents oAccBtn As Access.CommandButton

    Public Event Fire()

    Public Sub LaunchAccess()
        oAccApp.Visible = True
        oAccApp.OpenCurrentDatabase("C:\Temp\automation.mdb")
        oAccBtn = oAccApp.Forms("frmMain").Controls("cmdFireEvent")
    End Sub

    Private Sub Btn_Click() Handles oAccBtn.Click
        RaiseEvent Fire()
    End Sub

End Class

Has anyone successfully been able to do this?

-- 
AutomationGuru
Reynolds Automation Solutions
date: Sat, 4 Feb 2006 12:58:59 -0800   author:   AutomationGuru

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us