write conflict on main form when change on subform

shutzy

Registered User.
Local time
Today, 04:46
Joined
Sep 14, 2011
Messages
775
i a little frustrated and confused with this. i have a check box on my subform that when clicked enters an amount in the main form record. it changes automatically and when i do this i get a write conflict asking to save/cancel/drop.

ive tried to save the record on this event but it doesnt seem to help matters. how do i know where the write conflict is refering to, subform or main form. i presume its on the main form but i have no evidence of this.

just to note. when the main form is opened there is a record id, ie not (New). so there is a record that is being opened and changed. the record in the subform is also changed but it is changed directly.

hope all this makes sence.

by the way this is the vba i am using:
Code:
Private Sub checkPaidWithLoyaltyPoints_Click()
If Me.checkPaidWithLoyaltyPoints = True Then
If [OrdersItemsTypeID] > 1 Then
MsgBox "Loyalty Points Cannot Be Used With Retails Items", vbOKOnly, "No Loyalty On Retail!."
Me.checkPaidWithLoyaltyPoints.Value = False
Exit Sub
End If
If Me.ActualCost > [Forms]![frmClientSalePaymentScreen]![LoyaltyPointsAmount] - [Forms]![frmClientSalePaymentScreen]![ReceiptLoyaltyPoints] Then
MsgBox "Not Enough Loyalty Points Remaining!", vbOKOnly, "Not Enough Loyalty Points!."
Me.checkPaidWithLoyaltyPoints.Value = False
Else
[Forms]![frmClientSalePaymentScreen]![ReceiptLoyaltyPoints] = [Forms]![frmClientSalePaymentScreen]![ReceiptLoyaltyPoints] + Me.ActualCost
End If
Exit Sub
End If
If Me.checkPaidWithLoyaltyPoints = False Then
[Forms]![frmClientSalePaymentScreen]![ReceiptLoyaltyPoints] = [Forms]![frmClientSalePaymentScreen]![ReceiptLoyaltyPoints] - Me.ActualCost
Exit Sub
End If
End Sub

thank you
 
Last edited:
this is now solved. the easiest fix ever

Forms!etc.etc..SetFocus

no write conflict
 
aaargh. too hasty. now i get the write conflict when i try and save the record. why?
 

Users who are viewing this thread

Back
Top Bottom