View Single Post
  #3  
Old September 8th, 2004, 07:18 PM
Tim Ferguson
external usenet poster
 
Posts: n/a
Default

"Bryan Hughes" wrote in news:
:

I want them to be used as temp tables and deleted
on opening and closing of the fe.



Just a thought -- this is likely to cause a great deal of file bloat. I
would recommend one of:

1) Keep the temp table, but empty it before use with a

CurrentDB().Execute "DELETE FROM MyTempTable", dbFailOnError


2) Create the temp table in a temporary mdb file, which you can delete
afterwards:

' create a new empty database
Set dbTemp = ws.CreateDatabase("h:\temp\~928347.mdb", etc)

' create the new table inside it
dbTemp.Execute "CREATE TABLE MyTemp... etc", dbFailOnError


' and link it in to current Front End
Set dbFE = CurrentDB()
dbFE.tablefs.Append dbFE.CreateTableDef(acLinkedTable, etc)


and then at the end...

' unlink it
dbFE.TableDefs("NewTempTable")

' and get rid of the temp file
Kill "h:\temp\~928347.mdb"


FWIW, I think I'd go for the first one, but it's whatever suits your
needs.

B Wishes


Tim F