Hi
I have a Form that includes a subform. The subform contains 4 fields
and a check box.
ie
Quantity Integer
PriceA Double
PriceB Double
Total Double
PriceCheck CheckBox
On the Open Event of the main form a Message Box appears asking whether PriceCheck is to be checked
or not. After the choice is made by the user Quantity get the focus.
On the Lost Focus Event of Quantity the following happens
If PriceCheck is checked then Quantity is multiplied by PriceA
If Pricecheck is not checked then Quantity is multiplied by PriceB
The result of the above appear in Total.
The problem is it only works for the first record
on the subform. If there is more than one record
on the subform it just copies the value it finds in
Total on the record before.
Lost Focus Event of Quantity
Viri
I have a Form that includes a subform. The subform contains 4 fields
and a check box.
ie
Quantity Integer
PriceA Double
PriceB Double
Total Double
PriceCheck CheckBox
On the Open Event of the main form a Message Box appears asking whether PriceCheck is to be checked
or not. After the choice is made by the user Quantity get the focus.
On the Lost Focus Event of Quantity the following happens
If PriceCheck is checked then Quantity is multiplied by PriceA
If Pricecheck is not checked then Quantity is multiplied by PriceB
The result of the above appear in Total.
The problem is it only works for the first record
on the subform. If there is more than one record
on the subform it just copies the value it finds in
Total on the record before.
Lost Focus Event of Quantity
Code:
If Me.PriceCheck = True Then
Me.Total = Me.Quantity * Me.PriceA
Else
Me.Total = Me.Quantity * Me.PriceB
End If
Viri