spinjector
Programmer
I am trying to create a temporary table in memory to manipulate some data on a form. I am trying to do it without appending it to the TableDefs collection. (Is this possible?)
When I try to open a table-type recordset on the table, I get the following error:
Run-time error '3420': Object invalid or no longer set.
Here is a simplified version of my code with comments:
Any suggestions?
Thanks.
When I try to open a table-type recordset on the table, I get the following error:
Run-time error '3420': Object invalid or no longer set.
Here is a simplified version of my code with comments:
Code:
Public Sub Test()
Dim db As DAO.Database
Dim t As DAO.TableDef
Dim f As DAO.Field
Dim rs As DAO.Recordset
Set db = CurrentDb()
Set t = db.CreateTableDef()
Set f = t.CreateField("Name", dbText)
t.Fields.Append f
'<--- i am probably missing something here
' or not doing the next line correctly
Set rs = t.OpenRecordset() '<--- runtime error 3420 here
rs.Fields("Name") = "test"
rs.Update
End Sub
Any suggestions?
Thanks.