Oops, shoulda included the code...
' Get default Workspace.
Set wrkDefault = DBEngine.Workspaces(0)
strTempDatabase = Left$(CurrentDb.Name, Len(CurrentDb.Name) - 4) & "
temp.mdb"
' Make sure there isn't already a file with the name of
' the new database.
If Dir(strTempDatabase) <> "" Then Kill strTempDatabase
'Create a new temp database
Set dbsTemp = wrkDefault.CreateDatabase(strTempDatabase, dbLangGeneral)
strTableName = "tblTempMatreq"
'strBracketedTableName = "[" & strTableName & "]"
' Delete the link to the temp table if it exists
If TableExists(strTableName) Then
CurrentDb.TableDefs.delete strTableName
End If
' Create the temp table
Set tdfNew = dbsTemp.CreateTableDef(strTableName)
With tdfNew
.Fields.Append .CreateField("RowNbr", dbDouble)
rstCellMap.MoveFirst
While Not rstCellMap.EOF
If rstCellMap!Action = "Keep" Then
.Fields.Append .CreateField(rstCellMap!colname, dbText, 250)
End If
rstCellMap.MoveNext
Wend
dbsTemp.TableDefs.Append tdfNew
End With
dbsTemp.TableDefs.Refresh