i have 2 tables named Debts & History
i have a form that is named Frmorders
now there is a comobox named CmbStatus
it has 2 things
Paid
NotPaid
i have also Have a form named FrmDebts
now if i pick "paid" from the CmbStatus and hit the save button then in the the history table
it is storing the values of the order like i want and everything is ok
if i choose "NotPaid" from the CmbStatus
then the Debth table stores the value of the order and that is find
the problem is
if i choose "NotPaid" from the CmbStatus and then the customer pays me and i want to go back and change it to paid
then not only it dosnt delete from the Debt table the Debt of the customer it stores again the same values like i did a insert statment
how do i pick "NotPaid" from the CmbStatus and save it and if the customers pays me then it will delete his debt
and update the history table.
i cant figure this
this is my code:
i have a form that is named Frmorders
now there is a comobox named CmbStatus
it has 2 things
Paid
NotPaid
i have also Have a form named FrmDebts
now if i pick "paid" from the CmbStatus and hit the save button then in the the history table
it is storing the values of the order like i want and everything is ok
if i choose "NotPaid" from the CmbStatus
then the Debth table stores the value of the order and that is find
the problem is
if i choose "NotPaid" from the CmbStatus and then the customer pays me and i want to go back and change it to paid
then not only it dosnt delete from the Debt table the Debt of the customer it stores again the same values like i did a insert statment
how do i pick "NotPaid" from the CmbStatus and save it and if the customers pays me then it will delete his debt
and update the history table.
i cant figure this
this is my code: