G
Guest
Hello -
From an Access VBA module, I'm trying to pass a Table to a VB.Net class.
I'm getting the following error running the VBA:
"Unable to cast object of type System._ComObject to type
System.Data.Datatable"
The code resulting in the error looks like the following
In VBA:
Dim mclass As myClass
Set mclass = New myClass
Set mclass.ContractTable = CurrentDb().OpenRecordset("Contract")
In VB.Net:
Public Class myClass
Private myrstContract As Data.DataTable
WriteOnly Property ContractTable() As DataTable
Set(ByVal Value As DataTable)
myrstContract = Value
End Set
End Property
End Class
Suggestions?
Thank you as always,
Mark
From an Access VBA module, I'm trying to pass a Table to a VB.Net class.
I'm getting the following error running the VBA:
"Unable to cast object of type System._ComObject to type
System.Data.Datatable"
The code resulting in the error looks like the following
In VBA:
Dim mclass As myClass
Set mclass = New myClass
Set mclass.ContractTable = CurrentDb().OpenRecordset("Contract")
In VB.Net:
Public Class myClass
Private myrstContract As Data.DataTable
WriteOnly Property ContractTable() As DataTable
Set(ByVal Value As DataTable)
myrstContract = Value
End Set
End Property
End Class
Suggestions?
Thank you as always,
Mark