0

Need some help with this problem.

On the following table

```
Supplies
Storedlocation
```

Containing the following rows

```
5 A
2 A
3 B
2 A
2 A
2 A
2 B
2 B
```

Here is my code to display the sum of supplies based on the stored location

```
select sum(supplies) from store where storedlocation ='" & textbox1.Text & "'"
```

The result would be

13 A

7 B

The problem is how to cut that value if someone takes some supplies from certain stored location

lets say someone take 2 from location A

and the the result would be the following table

```
3 A
2 A
3 B
2 A
2 A
2 A
2 B
2 B
```

11 for A and 7 for B.

how can i achieve this. Thanks in advance