AOGFADUGBA
Board Regular
- Joined
- Sep 30, 2015
- Messages
- 74
Hi All, i have a form and i want two fields to be updadated with the content of another field based on a condition.
the fields are "PChequeNo" "PCash D" "PAmount P" "PBankNet" .
PChequeNo is a text field
PCash D, PAmount P, PBankNet are all currency field
i want if payment is made by cheque (PChequeNo will not be empty) the amount paid (PAmount P) will appear in the PBankNet field, but if cash is paid(PChequeNo will be empty) then it will appear in the paid cash (Pcash D) field.
below is the code i wrote. it worked to a point:
Private Sub FA_AfterUpdate()
If IsNull(Me.PChequeNo) Then
[PCash_D] = PAmount_P
ElseIf Not Me.PChequeNo Then
[PBankNet] = PAmount_P
End If
End Sub
if the PChequeNo field content is deleted the PBankNet Field still retain the amount paid and so does Pcash D.
But if the PChequeNo is not empty, PBankNet Field retain the amount paid and Pcash D remains empty again
Please can someone help
the fields are "PChequeNo" "PCash D" "PAmount P" "PBankNet" .
PChequeNo is a text field
PCash D, PAmount P, PBankNet are all currency field
i want if payment is made by cheque (PChequeNo will not be empty) the amount paid (PAmount P) will appear in the PBankNet field, but if cash is paid(PChequeNo will be empty) then it will appear in the paid cash (Pcash D) field.
below is the code i wrote. it worked to a point:
Private Sub FA_AfterUpdate()
If IsNull(Me.PChequeNo) Then
[PCash_D] = PAmount_P
ElseIf Not Me.PChequeNo Then
[PBankNet] = PAmount_P
End If
End Sub
if the PChequeNo field content is deleted the PBankNet Field still retain the amount paid and so does Pcash D.
But if the PChequeNo is not empty, PBankNet Field retain the amount paid and Pcash D remains empty again
Please can someone help