Hi,
I seem to be stuck creating an empty DAO recordset so I can add records to it on the fly and use it to create an XLS file.
I have..
It compiles without error, but when I try to use the class, I get 'object invalid or no longer set' error , which points to
What am I doing wrong?
Thanks,
1DMF.
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Dance Music Downloads
I seem to be stuck creating an empty DAO recordset so I can add records to it on the fly and use it to create an XLS file.
I have..
Code:
Private Sub Class_Initialize()
Dim tbl As DAO.TableDef
'define current database
Set db = CurrentDb()
'create table
Set tbl = db.CreateTableDef
'create fields for table
With tbl
.Fields.Append .CreateField("Field 1", dbText)
.Fields.Append .CreateField("Field 2", dbText)
.Fields.Append .CreateField("Field 3", dbInteger)
End With
' create recordset for the blank table
Set rsProcess = tbl.OpenRecordset
rsProcess.AddNew
rsProcess("Field 1").value = "test"
rsProcess.Update
End Sub
It compiles without error, but when I try to use the class, I get 'object invalid or no longer set' error , which points to
Code:
Set rsProcess = tbl.OpenRecordset
What am I doing wrong?
Thanks,
1DMF.
"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."
"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Dance Music Downloads