M
Mike Thomas
I am trying to create a temporary table to use in a datasheet subform, the
subform is bound to the table, and would like to do it in one of the methods
of either the parent form or the subform.
The 'open' methods in both forms seem too late. I receive the error that
the table tt_RctItem cannot be found when the form is loading.
To create the table, I am calling a procedure, Creatett_RctItem,
Public Sub Creatett_RctItem()
Dim tbl As TableDef
Dim fld As Field
On Error Resume Next
CurrentDb.TableDefs.Delete "tt_RctItem"
On Error GoTo 0
Set tbl = CurrentDb.CreateTableDef("tt_RctItem")
Set fld = tbl.CreateField("PartKey", dbLong)
fld.OrdinalPosition = 1
tbl.Fields.Append fld
Set fld = tbl.CreateField("RecdQuantity", dbLong)
fld.OrdinalPosition = 2
tbl.Fields.Append fld
CurrentDb.TableDefs.Append tbl
End Sub
Is there a way to call this proc in either the parent form or the subform's
code, and do it early enough that the subform can load, bound to this new
and empty table?
Many thanks
Mike Thomas
subform is bound to the table, and would like to do it in one of the methods
of either the parent form or the subform.
The 'open' methods in both forms seem too late. I receive the error that
the table tt_RctItem cannot be found when the form is loading.
To create the table, I am calling a procedure, Creatett_RctItem,
Public Sub Creatett_RctItem()
Dim tbl As TableDef
Dim fld As Field
On Error Resume Next
CurrentDb.TableDefs.Delete "tt_RctItem"
On Error GoTo 0
Set tbl = CurrentDb.CreateTableDef("tt_RctItem")
Set fld = tbl.CreateField("PartKey", dbLong)
fld.OrdinalPosition = 1
tbl.Fields.Append fld
Set fld = tbl.CreateField("RecdQuantity", dbLong)
fld.OrdinalPosition = 2
tbl.Fields.Append fld
CurrentDb.TableDefs.Append tbl
End Sub
Is there a way to call this proc in either the parent form or the subform's
code, and do it early enough that the subform can load, bound to this new
and empty table?
Many thanks
Mike Thomas