nkechifesie
06-27-2007, 02:10 AM
I was given a database program in Access to improve. This included enabling an exported table in excel which after update should be able to import back into the previous table.
The issue is that the table name has a space. I tried putting it in brackets but this is causing it to be duplicated adding 1,2... to the end of the table name.
I tried changing the name but there are so many codes, macros and queries attached to this table.Please how can I use my code
the table name is "T_Global tracking".
This is my code:
Set DBBsc = DBEngine.Workspaces(0).Databases(0)
Set QBsc = DBEngine.Workspaces(0).Databases(0)
Set QBsc = DBBsc.CreateQueryDef("", "DELETE * FROM [T_GLobal tracking]")
QBsc.Execute
QBsc.Close
DBBsc.Close
Set QBsc = Nothing
Set DBBsc = Nothing
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "[T_GLobal tracking]", "C:\GLobal tracking.xls", True
MsgBox "The Global tracking has been updated", vbOKOnly, "SITE TRACKING"
The issue is that the table name has a space. I tried putting it in brackets but this is causing it to be duplicated adding 1,2... to the end of the table name.
I tried changing the name but there are so many codes, macros and queries attached to this table.Please how can I use my code
the table name is "T_Global tracking".
This is my code:
Set DBBsc = DBEngine.Workspaces(0).Databases(0)
Set QBsc = DBEngine.Workspaces(0).Databases(0)
Set QBsc = DBBsc.CreateQueryDef("", "DELETE * FROM [T_GLobal tracking]")
QBsc.Execute
QBsc.Close
DBBsc.Close
Set QBsc = Nothing
Set DBBsc = Nothing
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "[T_GLobal tracking]", "C:\GLobal tracking.xls", True
MsgBox "The Global tracking has been updated", vbOKOnly, "SITE TRACKING"