hardhitter06
Registered User.
- Local time
- Today, 10:53
- Joined
- Dec 21, 2006
- Messages
- 600
Hi Everyone,
Access 2003.
I am new to access and this is going to be the first time I attempt to archive or just delete old records, on one of the databases I have created. I first need an approach on how I am going to solve my problem along with some help with coding.
Here is the situation:
My database has 2 operations both centered around a “UNSPSC” code. This given code and 4 other fields (FedID, CommAmt, Date, PONumber) is all the data this database consists of. To give some meaning to this UNSPSC code, it is an 8 digit number that links to Purchase orders in my office. The two operations my database can perform are to Input a new UNSPSC code (with these fields) if this code doesn’t exist or to search a UNSPSC code to retrieve the records that correspond with this number.
Another important field on the Input/Search forms is CommAmt. This is the amount the user is going to spend given the Purchase order and date (of the PO) that is on the UNSPSC form. The catch is given this UNSPSC code, a user CAN ONLY spend 20,000 in a 365 day span from any PO dates. For example, a user receives a purchase order with a UNSPSC code of 123 for the first time with a date of 3/1/08 and $10,000. They will input this information and will still have 10,000 more to spend within a years time from 3/1/08 (So 3/2/09 the limit will reset to another 20,000 if no other POs fall in this window). Come 10/1/08, another $10,000 purchase order comes with the UNSPSC code of 123 and the user inputs this information once again. Now, the user has reached the 20,000 limit. The user MAY NOT enter another Purchase Order/Date/Amt no sooner than 3/2/09. Now on 3/2/09, the user has $10,000 of the budget left because although the 3/1/08 PO of 10,000 has been over 365 days, the 10/1/08 is still active and you have up to 10/2/09 now to spend 20,000 total. To continue this example, on 5/1/09, user inputs a PO with $5000. Now the user has only $5000 left to spend because now the new period is from 10/1/08-10/2/09 and the previous $10,000 amount is now active with the 5/1/09 PO. Therefore, come 10/2/09, the latest $10,000 PO on 10/1/08 is no longer active (or within the 365 day span) and the user is left with $15000 to spend. I know this sounds extremely confusing so here is a chart to help matters:
Date---------Purchase---------Amount Removed----------Remaining Limit
3/1/08------$10,000-------------$0-----------------------------10,000
10/1/08---- $10,000-------------$0-----------------------------0
3/2/09------$0--------------------$10,000----------------------$10,000
5/1/09------$5,000---------------$0-----------------------------$5,000
10/2/09---- $0--------------------$10,000----------------------$15,000
5/2/10------$0 -------------------5,000-------------------------$20,000
--- Spacing purposes
So basically it’s a flex year because you never really know when the year’s budget will begin, but what is always a given is the 20,000 dollar CommAmt over a 365 day span starting with the first PO Date.
An idea I thought maybe could work is on the input screen, when a user went to fill in a CommAmt after the date was entered, for it to return a Error message explaining that they have exceeded the Budget Amt and either will have to return at a later date or could even display the date when they amt will reset. This would mean it would have to search within the table (there’s only one tbl in this database) to find out what the 365 span is with the amts. I’m not sure…
If there is a better idea out there, pllllllzzzzz help me out because this is the last thing I need to figure out and this database will be set to go.
Thank you!!
Access 2003.
I am new to access and this is going to be the first time I attempt to archive or just delete old records, on one of the databases I have created. I first need an approach on how I am going to solve my problem along with some help with coding.
Here is the situation:
My database has 2 operations both centered around a “UNSPSC” code. This given code and 4 other fields (FedID, CommAmt, Date, PONumber) is all the data this database consists of. To give some meaning to this UNSPSC code, it is an 8 digit number that links to Purchase orders in my office. The two operations my database can perform are to Input a new UNSPSC code (with these fields) if this code doesn’t exist or to search a UNSPSC code to retrieve the records that correspond with this number.
Another important field on the Input/Search forms is CommAmt. This is the amount the user is going to spend given the Purchase order and date (of the PO) that is on the UNSPSC form. The catch is given this UNSPSC code, a user CAN ONLY spend 20,000 in a 365 day span from any PO dates. For example, a user receives a purchase order with a UNSPSC code of 123 for the first time with a date of 3/1/08 and $10,000. They will input this information and will still have 10,000 more to spend within a years time from 3/1/08 (So 3/2/09 the limit will reset to another 20,000 if no other POs fall in this window). Come 10/1/08, another $10,000 purchase order comes with the UNSPSC code of 123 and the user inputs this information once again. Now, the user has reached the 20,000 limit. The user MAY NOT enter another Purchase Order/Date/Amt no sooner than 3/2/09. Now on 3/2/09, the user has $10,000 of the budget left because although the 3/1/08 PO of 10,000 has been over 365 days, the 10/1/08 is still active and you have up to 10/2/09 now to spend 20,000 total. To continue this example, on 5/1/09, user inputs a PO with $5000. Now the user has only $5000 left to spend because now the new period is from 10/1/08-10/2/09 and the previous $10,000 amount is now active with the 5/1/09 PO. Therefore, come 10/2/09, the latest $10,000 PO on 10/1/08 is no longer active (or within the 365 day span) and the user is left with $15000 to spend. I know this sounds extremely confusing so here is a chart to help matters:
Date---------Purchase---------Amount Removed----------Remaining Limit
3/1/08------$10,000-------------$0-----------------------------10,000
10/1/08---- $10,000-------------$0-----------------------------0
3/2/09------$0--------------------$10,000----------------------$10,000
5/1/09------$5,000---------------$0-----------------------------$5,000
10/2/09---- $0--------------------$10,000----------------------$15,000
5/2/10------$0 -------------------5,000-------------------------$20,000
--- Spacing purposes
So basically it’s a flex year because you never really know when the year’s budget will begin, but what is always a given is the 20,000 dollar CommAmt over a 365 day span starting with the first PO Date.
An idea I thought maybe could work is on the input screen, when a user went to fill in a CommAmt after the date was entered, for it to return a Error message explaining that they have exceeded the Budget Amt and either will have to return at a later date or could even display the date when they amt will reset. This would mean it would have to search within the table (there’s only one tbl in this database) to find out what the 365 span is with the amts. I’m not sure…
If there is a better idea out there, pllllllzzzzz help me out because this is the last thing I need to figure out and this database will be set to go.
Thank you!!
Attachments
Last edited: