1) You are using Amount in 2 different ways: as the amount entered and the
result of Entry + Balancer. It can't be both.
2) Not sure under what circumstances a fruit storekeeper would ever
enter -20, but here's your answer:
In AmountEntry_AfterUpdate:
if AmountEntry < 0 then
Balancer = abs(AmountEntry)
else
Balancer = 0
end if
--
George Nicholson
Remove 'Junk' from return address.
"kennykee" <(E-Mail Removed)> wrote in message
news:6D2391CE-EB48-4BC7-9AE2-(E-Mail Removed)...
>I got two text box namely : [Amount] and [Balancer]
>
> Relationship
> [Amount] + [Balancer] >= 0
>
> The value [Amount] will reduce everyday until zero. Then, I need the
> [Balancer] to automatically increase its value to prevent negative
> condition
> occurs.
>
> eg.
> Let say i am a fruit storkeeper
> [Amount] increases when i add in "banana" stock but [Amount] cannot be
> negative if [Amount] run out of stock.
>
> Hence, what code can automatically make the value of [Balance] to increase
> so it can add into [Amount] to prevent [Amount] from being negative.
>
> Data entry==>[Balancer]+[Amount]==>[Amount]==>positive value
>
> eg
> Data entry = -20
> Automatically [Balancer] = 20
> [Amount] = 0 (it will always more or equal to zero)
>
>
> Any solutions?
>
> Thanks in advance.
>
> Kennykee
|