Sensibilium
Programmer
I have an order entry form, including a subform, but I am having problems saving the 'OrderValue' field in my 'tblPUOrders' table, please see below my code under the main form (frmNewPurchaseOrder):<br><br><-----------<br>Private Sub Form_BeforeUpdate(Cancel As Integer)<br> If IsNull(CountryOfOrigin) Then Me!CountryOfOrigin = GetOriginCountry(SupplierID)<br> If Not IsNull(ProductType) Then<br> If Me!OrderValue <> DollarOrderValue Or IsNull(Me!OrderValue) Then Me!OrderValue = DollarOrderValue<br> StdDuty = GetDutyRate(Me!CountryOfOrigin, Me!ProductType)<br> StdValue = GetStdSterlingValue(DollarOrderValue, StdDuty)<br> StdExchange = DollarRate<br> Else<br> StdDuty = 0<br> StdValue = 0<br> StdExchange = 0<br> End If<br> PUOrderID.SetFocus<br> Me.Refresh<br>End Sub<br><br>Private Sub Form_Current()<br> If Not IsNull(CountryOfOrigin) Or Not IsNull(ProductType) Then<br> StdDuty = GetDutyRate(Me!CountryOfOrigin, Me!ProductType)<br> StdValue = GetStdSterlingValue(DollarOrderValue, StdDuty)<br> StdExchange = DollarRate<br> Me.Repaint<br> End If<br>End Sub<br>--------------><br><br>If I put a break in the code, it works and updates the underlying table! If I remove the break, it doesn't work! The controls that are affected are OrderValue & StdValue. In fact, when the break is removed both these controls reset to 0.00 for each record looked at through this form.<br><br>'CountryOfOrigin', 'ProductType', 'SupplierID', 'OrderValue' are all bound controls (to tblPUOrders)<br>'StdDuty', 'StdValue', 'StdExchange', 'DollarOrderValue' are all unbound controls.<br>'GetOriginCountry', 'GetDutyRate', 'GetStdSterlingValue' are Functions in my global VB Module (all correct).<br><br>'DollarOrderValue' is a calculated control taken from the subform control 'SubformTotal' (Sum(tblPUOrderDetails!LineTotal)), this is always calculated correctly.<br><br>Please help, I've been avoiding this problem for about 3 weeks, but I really need to finish this particular form.<br><br>Thanks in advance.<br>