Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving a custom object in an Access 97 table

Status
Not open for further replies.

GusBrown

Programmer
Nov 24, 2000
38
0
0
GB
Hi,

I'm doing some vba dev with Access 97 and I have a question for you all:

If I define a custom class module (call it myClass) and then instantiate an instance of that object somewhere in some code (call the instance myObj) can I save that object directly into a table?

What I'm really trying to do is this:

Dim myObj As myClass
Dim myRecSet As Recordset

Set myObj = New myClass
Set myRecSet = CurrentDb.OpenRecordset( "myTable", dbOpenDynaset)

With myRecSet
.AddNew
![myField] = myObj
.Update
.Close
End With

I've tried it with myField defined as an OLE/Object but with no success. Any ideas?

Thanks,

Gus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top