subtraction

lead 27

Registered User.
Local time
Yesterday, 22:14
Joined
Mar 24, 2007
Messages
147
Hi

Hopefully just a quick one.
How would i go about making a an update button so that when i type a number in an unbound text box and click the button it subtracts this number from a quantaty field?
 
In the onClick event for the button have quantityfield = quantityfield-subtractNumber
 
in the onclick of the button you would do

me.anotherunboundfieldontheform= me.quantitytxtboxname - me.unboundtxtboxname

this doesnt need to be store in the table right? if it does there are numerous examples regarding stock quantity on this forum. search on that
 
Do you know how I can clear the text box after the botton is clicked
 
Adding
Me!unboundtextbox = 0

after the subtraction code
should do the trick
 
I don't know what the underlying process is, but subtracting like this is a bit dangerous. How many times has the button been clicked?
 
I don't know what the underlying process is, but subtracting like this is a bit dangerous. How many times has the button been clicked?

Thats why I recommended setting the subtract text box to 0.
 
Re: subraction

I need to subtract on a DB that I created. I have one table and I want to subtract from 2 fields. I saw a post on one of the replies and try to do it that way but I coudn't get it to work. I am using Access 2010

thanks.
 

Users who are viewing this thread

Back
Top Bottom