@Jim
you told me before that if i put code in the OnCurrent event of the form; then it would get executed for the current detail line whenever i change from one row to another.
I have a Continuous Forms that contain these text box:
txtArticle bound to 'Article' in table item
txtPrice bound to 'Real_Price' in table item
txtDiscountedPr ice bound to 'Price_After_Di scount' in table item
txtCashMoney bound to 'Cash' in Invoice table
and i want to every time that i insert an new article in the invoice to check weather the that article had a discount price or not , if yes i want to set the txtCashMoney to the 'Price_After_Di scount' , if not i want to set the value of the txtCashMoney to the 'Real_Price' .
so i tried this code :
but it's not working
you told me before that if i put code in the OnCurrent event of the form; then it would get executed for the current detail line whenever i change from one row to another.
I have a Continuous Forms that contain these text box:
txtArticle bound to 'Article' in table item
txtPrice bound to 'Real_Price' in table item
txtDiscountedPr ice bound to 'Price_After_Di scount' in table item
txtCashMoney bound to 'Cash' in Invoice table
and i want to every time that i insert an new article in the invoice to check weather the that article had a discount price or not , if yes i want to set the txtCashMoney to the 'Price_After_Di scount' , if not i want to set the value of the txtCashMoney to the 'Real_Price' .
so i tried this code :
Code:
Private Sub Form_Current() If (IsNull(Forms![item1]![Price_after_discount])) Then Forms![item1]![prix_vente_unitaire] = Forms![item1]![Price] Else Forms![item1]!prix_vente_unitaire = Forms![item1]![Price_after_discount] End If End Sub
Comment