line 22: it starts with SELECT it is retreiving data from the database
line 23: Take the date value from the database record "qrs1!ManualWeightDat" and remove 1 day from the date
line 24: Take the date calculated on line 23 and remove 1 month
i think Me!DR6TransactionId is the ID
dbOpenDynaset is a keyword
It opens a dynaset-type Recordset
dbOpenForwardOnly opens a forward-only type Recordset
if you declare qrs1 as a recordset, and qrs2 as a recordset
then you can store the results of two seperate queries
Line 37: it's creating a table object and then populating it
Line 38: is adding a column to the new table called "JurisdictionName
DB is declared up top.. Dim db As Database
so "db" is a database object... and line 55 is adding this newly created table to the database
After this I'm lost, can some explain to me the rest of the thing goes.
I doubt someone is going to explain, line for line, the code. But I will help with understanding of the code in a general manner.
First, you need to understand that a recordset is similar to a table. There can be 1 to n records in a recordset, but the thing to keep in mind is you can only access one record in a recordset at one time. So the code after line 55 is looping through the recordsets.
Line 22 through 34 are setting up 5 recordsets with data. Then line 57 is opening up the empty table, TempTable4, so that you can add records to it.
59 through 64 loop through qrs2 and total up the CommodityWeight to get the TotalCommodityWeight(?).
The rest of it is populating the TempTable4 with data. When you see trs it is referencing the table. AddNew adds a new record to the table, then all of the trs!BlahBlah are assigning values to the fields in the table. When you see and Update, that means, write the data to the table. Imagine you are adding a record to a table manually (by typing the data). You would have to start at the first field and type in the data you wanted. You would enter data in all the fields until you get to the last one. Once you get to th last field and press enter, the record is saved to the table. Until that point you can press the Esc button to abort saving the record. Same thing with a recordset. Update all the fields then tell it to update the recordset with Update.
The last part opens qr5 and edits the data with Edit. Then it sets the DR6Done field to True. And updates the record with Update.
The rest of if cleans up the recordsets by closing them and finally the report is printed, I am assuming based on the data in the TempTable4.
And the very last part is error trapping. If an error occurs the program will jump to the bombout tag. Line 2 tells Access what to do if there is an error. The bombout tag reports the error then calls the depart tag to turn the Echo back on (so that the screen refreshes properly) and also turns the Hourglass off.
Can someone tell me what calculation is it actually doing? I want to dump this old code and in order to do this, I need to see what this code does. I mean what is it calculating. If someone can tell me what data it use to calculate his result that will be awsome.
I just need to build a new code that will do the excat stuff, but in order to build a new code. I need to know what its calculating.
Can someone please tell me what is calculating and how is he getting his result?
This way I will know what to code on my new code..