![]() |
|
|
#1
|
|||
|
|||
|
Hi folks,
Running Access 2003 I'm trying to figure out a way to define a data type (consisting of several elements) and to then store/retrieve this data type in a field of a table. I've tried Memo and OLE Object field types. The code fragment below generates the following error message: Compile Error. Only user-defined types defined in public object models can be coerced to or from a variant or passed to late-bound functions. I've also (so far) been unable to figure out what a "public object model" is, or how to define one. Is it even possible to store user-defined data types in Access 2003? Any insight on this would be appreciated. Thanks, Binky Code fragment: Option Compare Database Option Explicit Public Type Test_type strTest1 As String lngTest2 As Long strTest3 As String dtTest4 As Date strTest5 As String End Type Public Sub testit1() Dim dbsMe As Database Dim rsMe As Recordset Dim ttMe As Test_type Set dbsMe = CurrentDb Set rsMe = dbsMe.OpenRecordset("tblTEST1") ttMe.strTest1 = "Beginning..." ttMe.dtTest4 = #1/1/2007# rsMe.AddNew rsMe!TEST_STRUCT = ttMe rsMe.Update rsMe.Close Set rsMe = Nothing Set dbsMe = Nothing End Sub |
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| New Access User | Mermaid | Access | 0 | 11-07-2008 11:28 AM |
| New Database - New User | mcarrigg | Database Design | 1 | 06-21-2008 02:56 PM |
| How to store the Field value at query to table?? | Maxzs | Queries | 0 | 09-25-2006 01:42 AM |
| Is Access right for what I trying to do? New user. | redsled | Access | 1 | 08-16-2006 10:44 AM |
| Count and recount for every new user per day? | valkyry | Queries | 0 | 07-24-2006 01:37 PM |