T. McConnell
Registered User.
- Local time
- Today, 02:45
- Joined
- Jun 21, 2019
- Messages
- 63
Name is confusing sorry, basically I have a query that takes a cost price and multiplies it by the quantity. I then pass that total to an unbound field that then updates a bound field. Yes I know not to store calculated fields in a table, but it seems harder to not store the "sale" of the part. My main issue is when trying to get the fields to update with the correct amount.
What is happening is I have a subform that I select a product, then select the quantity, I have hidden fields which stores the value of the cost and the total of quantity times cost price. It then passes that to an unbound text field on the mainform, this part is working fine, I am trying to get that value to update the bound field on the mainform when the quantity changes on the subform. However when I change the quantity, the unbound field calculates fine, but the bound field seems to be behind one quantity. Almost like it is calculating the quantity minus 1, if I click in another field on the main form (set to update the fields) this works fine, just when trying to get the change in the subform to update the bound field on the mainform.
What I have tried is putting on the afterupdate, beforeupdate, onchange of the quantity field, the subform, the unbound field, using a requery of the fields that calculate the fields to the bound text field. I have even tried putting the code on the mainforms unbound field
No matter what I seem to try the calculation is not correct, like it is off by a quantity of 1.
Any help again is greatly appreciated.
What is happening is I have a subform that I select a product, then select the quantity, I have hidden fields which stores the value of the cost and the total of quantity times cost price. It then passes that to an unbound text field on the mainform, this part is working fine, I am trying to get that value to update the bound field on the mainform when the quantity changes on the subform. However when I change the quantity, the unbound field calculates fine, but the bound field seems to be behind one quantity. Almost like it is calculating the quantity minus 1, if I click in another field on the main form (set to update the fields) this works fine, just when trying to get the change in the subform to update the bound field on the mainform.
What I have tried is putting on the afterupdate, beforeupdate, onchange of the quantity field, the subform, the unbound field, using a requery of the fields that calculate the fields to the bound text field. I have even tried putting the code on the mainforms unbound field
Code:
Me.BoundField = Me.UnboundField
Any help again is greatly appreciated.