How to learn ActiveX controls from MS Access firewall forms using vb.net

I am developing a tool at vb.net and need to find ActiveX controls from MS Access db forms. I can configure the number of controls on a form, but I cannot get ActiveX controls from just the form. Can anyone figure out how to achieve this, please suggest.

+1


source to share


2 answers


Can you access the controltype property? If so, I cannot help with vb.net, but here are some VBA that might help.



ActiveXCount = 0
For Each ctl In Screen.ActiveForm
    If ctl.ControlType = 119 Then 'Custom control'
        'Debug.Print ctl.Class'
        ActiveXCount = ActiveXCount + 1
    End If
Next

      

+1


source


I'm not sure what you want. Try this: go to MS Access and create a new property which is the number of controls on the form. In VBA, me.Countrols.Count. Open the form using Access Automation. OnFOrmLoad () writes the number of controls to a text file along with the name of the form and then closes the form. After that open the text file in VB.net. It's indirect, but it will work.

How to automate Microsoft Access with Visual Basic .NET



To automate:

Dim oAccess As Access.Application

' Start a new instance of Access for Automation:
oAccess = New Access.ApplicationClass()

' Open a database in exclusive mode:
oAccess.OpenCurrentDatabase(filepath:="c:\mydb.mdb", Exclusive:=True)

oAccess.DoCmd.OpenForm(FormName:="Employees")

      

0


source







All Articles