WalkieTalkie
Technical User
I am building a database in Access 2003 for my not-for-profit childcare facility (why do I volunteer for these things??). Its purpose is to keep track of kids, parents, and sessions attended. So far, so good. We also want it to keep track of fees charged and payments made, so we can send out an invoice to parents each month. Sounds simple enough, but I'm having the following trouble:
The fees charged are dependent upon whether the account is in debit or credit. For example, if Account #1 is >= $0.00 on 1 May, then the fee charged that day is $10.00. But if the account balance is < $0.00, then the fee charged is $11.00
The code that makes this happen, is on the After_Update event of another field called AttendStatus, and is set out below:
This all works fine until we come to enter the payments made. Most payments are made by internet banking, and therefore aren’t entered into the database until some time after the transaction actually happened. So, the account will be charged as if it is in debit, when in reality it was in credit. For example:
Balance on 1 May is -$5.00.
Payment is made by internet on May 2 of $50, but is not entered into database yet.
Child attends on May 3, and is charged $11 because the database thinks the account is still in debit.
Payment entered into database by administrator on May 4, bringing the account into (belated) credit.
Irate parent rings up on May 5 when the invoice goes out, asking why her account was charged the penalty fee on May 3 for being in debit, when she had paid up and was in fact in credit.
What we need is some way to simply update all the Fee fields that follow the payment made.
So far, the only way I have been able to do this is by putting the same code on the On_Current event of the form. This way, after the payment is entered, the user scrolls the cursor through each record, the Fee field in each record is updated. But this is very clumsy and relies too much on the user remembering to do the scrolling – there’s just too much room for error. There must be a better way!
Can anyone help with a suggestion for a better way to deal with this issue? Maybe I’m making it too complicated and there might be a simpler way that I am missing completely?
(By the way, the data is recorded on frmTransaction, which has tblTransaction as its record source. tblTransaction has TransactionID as its primary key, related one to many with the primary table which is tblKidAccount.)
I hope I have provided enough information. I have spent many hours on this so far, with no success, so any and all help will be gratefully received!
The fees charged are dependent upon whether the account is in debit or credit. For example, if Account #1 is >= $0.00 on 1 May, then the fee charged that day is $10.00. But if the account balance is < $0.00, then the fee charged is $11.00
The code that makes this happen, is on the After_Update event of another field called AttendStatus, and is set out below:
Code:
If Me.txtBalance >= 0 - Me.Fee Then ‘if in credit balance
Me.Fee = “10”
Else 'if in debit
Me.Fee = “11”
End If
Balance on 1 May is -$5.00.
Payment is made by internet on May 2 of $50, but is not entered into database yet.
Child attends on May 3, and is charged $11 because the database thinks the account is still in debit.
Payment entered into database by administrator on May 4, bringing the account into (belated) credit.
Irate parent rings up on May 5 when the invoice goes out, asking why her account was charged the penalty fee on May 3 for being in debit, when she had paid up and was in fact in credit.
What we need is some way to simply update all the Fee fields that follow the payment made.
So far, the only way I have been able to do this is by putting the same code on the On_Current event of the form. This way, after the payment is entered, the user scrolls the cursor through each record, the Fee field in each record is updated. But this is very clumsy and relies too much on the user remembering to do the scrolling – there’s just too much room for error. There must be a better way!
Can anyone help with a suggestion for a better way to deal with this issue? Maybe I’m making it too complicated and there might be a simpler way that I am missing completely?
(By the way, the data is recorded on frmTransaction, which has tblTransaction as its record source. tblTransaction has TransactionID as its primary key, related one to many with the primary table which is tblKidAccount.)
I hope I have provided enough information. I have spent many hours on this so far, with no success, so any and all help will be gratefully received!