Expand|Select|Wrap|Line Numbers
- SELECT ChargeDate, Sum(ChargeAmount) AS DailyTotal
- FROM Charges
- GROUP BY ChargeDate;
Expand|Select|Wrap|Line Numbers
- Dim db as Database
- Set db = CurrentDb
- Dim rstDays as Recordset
- Set rstDays = db.OpenRecordset("Days", dbOpenDynaset)
- Dim DaysRC as Integer
- Dim DaysProgress as Integer
- With rstDays
- .MoveLast
- DaysRC = .RecordCount
- .MoveFirst
- SysCmd acSysCmdInitMeter, "Step 1 of 2...", DaysRC
- For DaysProgress = 1 To DaysRC
- SysCmd acSysCmdUpdateMeter, DaysProgress
- .Edit
- !Total = 0
- !Count = 0
- !Notes = ""
- .Update
- .MoveNext
- Next DaysProgress
- SysCmd acSysCmdRemoveMeter
- End With
- rstDays.Close
- Set rstDays = Nothing
- db.Close
- Set db = Nothing
I had to run this part of the routine several dozen times while I was experimenting with different data and debugging the rest of the procedure. Before I opened the file last night it was at about 80 MB, then at some point several hours later I checked again and my file was over 360 MB.
The first thing I tried to do was compact and repair, but that only cut it down a few MB. I ended up importing all of my other tables, forms, and queries into a new file, re-creating the Days table and re-establishing my relationships. After I did that I'm below 4 MB total, but now I'm afraid it is going to happen again because I need to run this procedure repeatedly. Does anyone know why this would happen? I'm nearly positive it is because I'm re-writing the values into those three fields of the Days table because that was the only table that was a problem, and that is the only operation I did on that table (*edit- I also re-wrote the field values later in the procedure). I don't understand why that would happen and why it wouldn't get fixed by compacting.