J
John T Ingato
I have three tables: tblStores, tblWeeklyInventoryCounts, tblProductList,
qryReportDates
The tblStores contains a listing of all stores that are currently open and
which should be reporting data each week
The tblProductList contain a list of products that should be in every open
store
The qryReportDates is a list of distinct dates in the
tblWeeklyInventoryCounts table
The tblweeklyInventoryCounts is a compilation of weekly data that is
imported in from excel every week. It contains the inventory level for each
product and for every store at the close of the week. The key fields being:
ReportDate, StoreNumber, ProductID, OnHandQty
My goal was to create a table of items that were sold at each store for each
week by subtracting last weeks (this weeks inventory level) - (last weeks
inventory level). I could not figure out how to do this in a query so I
decided to write the VBA code. Is there a way to perform this in a query
environment.
I was successful in creating the code and creating the table. The code also
affords me the ability to check whether this weeks inventory is greater then
last week, showing that the store must have received some product. Instead
of sales reflecting a negative amount, I can assign 0 sales.
The one problem is that the code take approx 30-40 minutes to run on 800,000
records. while it is running, I can not do anything else on my computer.
It seems to have full control. If I do try to do something else, the code
seems to freeze up or the cursor in the code window turn to an hourglass. I
have to ctrl+break / debug / and F5 to start it again. This happen if the
laptop goes into sleep mode also.
Is there a way to run this procedure in it own thread? Or to allow it to run
in the background? Or to stop the computer from entering stand-by?
qryReportDates
The tblStores contains a listing of all stores that are currently open and
which should be reporting data each week
The tblProductList contain a list of products that should be in every open
store
The qryReportDates is a list of distinct dates in the
tblWeeklyInventoryCounts table
The tblweeklyInventoryCounts is a compilation of weekly data that is
imported in from excel every week. It contains the inventory level for each
product and for every store at the close of the week. The key fields being:
ReportDate, StoreNumber, ProductID, OnHandQty
My goal was to create a table of items that were sold at each store for each
week by subtracting last weeks (this weeks inventory level) - (last weeks
inventory level). I could not figure out how to do this in a query so I
decided to write the VBA code. Is there a way to perform this in a query
environment.
I was successful in creating the code and creating the table. The code also
affords me the ability to check whether this weeks inventory is greater then
last week, showing that the store must have received some product. Instead
of sales reflecting a negative amount, I can assign 0 sales.
The one problem is that the code take approx 30-40 minutes to run on 800,000
records. while it is running, I can not do anything else on my computer.
It seems to have full control. If I do try to do something else, the code
seems to freeze up or the cursor in the code window turn to an hourglass. I
have to ctrl+break / debug / and F5 to start it again. This happen if the
laptop goes into sleep mode also.
Is there a way to run this procedure in it own thread? Or to allow it to run
in the background? Or to stop the computer from entering stand-by?