E
excel_hari
Hi,
I have created a database with a form having a single command button, a
query doing some simple join/union and finally 2 code modules.
The code for form is
Option Compare Database
Option Explicit
Private Sub Command0_Click()
Call LookupData
End Sub
The code for the first module is
Option Compare Database
Option Explicit
Sub LookupData()
'CurrentDb.Execute "Delete * from OSRM_Table "
'CurrentDb.Execute "Delete * from ISSM_Table "
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, _
"OSRM_Table", TestIt("OSRM"), True, "Report 1!"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, _
"ISSM_Table", TestIt("ISSM"), True, "ItemMaster!"
DoCmd.TransferSpreadsheet acExport, , "Specialized Query",
BrowseFolder("Select a BASE Folder") _
& "\OSRM_Table_SpecialData", True
CurrentDb.Execute "Drop table OSRM_Table;"
CurrentDb.Execute "Drop table ISSM_Table"
DoCmd.Quit
End Sub
The code for second module is just a copy paste of Testit function from
access mvps site and browse function from www.cpearson.com.
The code for Query is
SELECT "Special" As Category, OT.*
FROM OSRM_Table AS OT INNER JOIN ISSM_Table AS IT ON OT.[Prod Mfg SKU
Cd]=IT.PIN
WHERE (IT.[ISSD Special]="X")
UNION ALL SELECT "Not Special", OT.*
FROM OSRM_Table AS OT left JOIN ISSM_Table AS IT ON OT.[Prod Mfg SKU
Cd]=IT.PIN WHERE (((IT.[ISSD Special]) Is Null));
Basically, am using DB just to perform some lookup operation. If you
notice the first module above, then you will see that am dropping the
tables I created after my results get outputted. Inspite of dropping my
tables my DB size keeps on growing up from 124 MB to 230 MB to finally
336 MB right now. It seems each time I use this code (on the same set
of excel files) my DB size also keeps on increasing (am doing some
tweaking and fine tuning, so exporting the same excel files. How to
overcome the same?
Please guide me.
regards,
HP
India
I have created a database with a form having a single command button, a
query doing some simple join/union and finally 2 code modules.
The code for form is
Option Compare Database
Option Explicit
Private Sub Command0_Click()
Call LookupData
End Sub
The code for the first module is
Option Compare Database
Option Explicit
Sub LookupData()
'CurrentDb.Execute "Delete * from OSRM_Table "
'CurrentDb.Execute "Delete * from ISSM_Table "
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, _
"OSRM_Table", TestIt("OSRM"), True, "Report 1!"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel8, _
"ISSM_Table", TestIt("ISSM"), True, "ItemMaster!"
DoCmd.TransferSpreadsheet acExport, , "Specialized Query",
BrowseFolder("Select a BASE Folder") _
& "\OSRM_Table_SpecialData", True
CurrentDb.Execute "Drop table OSRM_Table;"
CurrentDb.Execute "Drop table ISSM_Table"
DoCmd.Quit
End Sub
The code for second module is just a copy paste of Testit function from
access mvps site and browse function from www.cpearson.com.
The code for Query is
SELECT "Special" As Category, OT.*
FROM OSRM_Table AS OT INNER JOIN ISSM_Table AS IT ON OT.[Prod Mfg SKU
Cd]=IT.PIN
WHERE (IT.[ISSD Special]="X")
UNION ALL SELECT "Not Special", OT.*
FROM OSRM_Table AS OT left JOIN ISSM_Table AS IT ON OT.[Prod Mfg SKU
Cd]=IT.PIN WHERE (((IT.[ISSD Special]) Is Null));
Basically, am using DB just to perform some lookup operation. If you
notice the first module above, then you will see that am dropping the
tables I created after my results get outputted. Inspite of dropping my
tables my DB size keeps on growing up from 124 MB to 230 MB to finally
336 MB right now. It seems each time I use this code (on the same set
of excel files) my DB size also keeps on increasing (am doing some
tweaking and fine tuning, so exporting the same excel files. How to
overcome the same?
Please guide me.
regards,
HP
India