I have a database that I am working on and am having trouble getting my code to generate multiple records at one time. Ex. One serial number would have multiple maintenance service dates, I wan't to schedule them all at one time.
Can You Help,
The general idea was for the main equipment form to generate in a second table scheduled maintenanc for the year. This will allow me as well as others to pull scheduled maintenance reports without having to generate code every time.
Normally, you would generate work orders for scheduled maintenance. This is not the same as simply generating the schedule. I would recommend you do not store a schedule, especially for the year in advance. A lot can happen before the schedule is ever fulfilled including liquidation of the equipment scheduled. It is more efficient to calculate what is due for maintenance closer to the time the work needs to be done and generate the necessary work orders for accomplishing this maintenance. For everything else, simply calculate the schedule and publish it whenever it's needed and for whatever projected time into the future you want but don't store this schedule in a table.
Thank You! This answers my first question. I also have a second qestion and I was hoping that my earlier question would have answered it. Here goes:
In the same database another section calculates fixed asset depreciation and I need the main depreciation form to generate, to a subform located on the main depreciation form, depreciation for the life of the asset by asset number, month, year and total depreciation to date. All the code is in place for the depreciation portion but I still need to be able to use VB code to generate multiple records to a separate table.
Here again, you should not store calculated results. Calculate the depreciation schedule on demand. Only generate actual records in the month the depreciation is taken. What you should do, though, is store the depreciation time frame through which you are taking it. i.e. 5 yrs, 10 yrs, 6 mos. whatever. Then, using the depreciation time line, date of purchase, purchase price, and any other factors for the depreciation, calculate the depreciation on demand. You can use already taken depreciation (again, calculated on demand from each record of depreciation actually taken) to know how much value is left in the asset. Doing it this way you will be much happier. Since you won't be taking depreciation in advance you will always only have the actual value on the books.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.