andymartin3186
Member
- Local time
- Today, 02:00
- Joined
- Dec 10, 2024
- Messages
- 31
Hi Everyone,
I'm sure this has been asked before so if needed please just point me to a video or thread that I need to study.
I have a job form where I can search for parts from a parts table, and add them to the job (jobparts table).
In the screenshot the top subform is a search lookup from the parts table and when you click the far right button it inserts them into the bottom subform which is the jobparts. You can then enter in a qty used. That all works great.
The thing I can't get my head round is keeping the qty's correct. If I for example add in qty 1, I want it to deduct this value from the stock qty, and I have had this working. However if I change the qty used to 2, the code I written was obviously too basic, and it then deducted a further 2 from the qty, instead of just a further 1.
Similarly if I change the qty used from 2 to 1, it should readd 1 back into the stock qty.
I can understand that I need to look at the initial value, the new value and then take the difference, but I'm struggling putting this into code.
Could anyone help me or point me in the right direction?
I'm sure this has been asked before so if needed please just point me to a video or thread that I need to study.
I have a job form where I can search for parts from a parts table, and add them to the job (jobparts table).
In the screenshot the top subform is a search lookup from the parts table and when you click the far right button it inserts them into the bottom subform which is the jobparts. You can then enter in a qty used. That all works great.
The thing I can't get my head round is keeping the qty's correct. If I for example add in qty 1, I want it to deduct this value from the stock qty, and I have had this working. However if I change the qty used to 2, the code I written was obviously too basic, and it then deducted a further 2 from the qty, instead of just a further 1.
Similarly if I change the qty used from 2 to 1, it should readd 1 back into the stock qty.
I can understand that I need to look at the initial value, the new value and then take the difference, but I'm struggling putting this into code.
Could anyone help me or point me in the right direction?