I have a field in my database called ‘Stock’. It displays how many items are there remaining for sale.Now I have a dropdowncombo with values like 1,2,3 etc… So now when I select an item in the grid and click the button SELL I would like the ‘Stock’ field of the item in question (in the grid) to decrease by the amount that was in the combo. So if the ‘stock’ was 100 and I sell 5 (dropdowncombo value) I would like the grid value to display now 95. I hope you know what I mean… I could do this with inserting a calculated field but I do not want to. Better an UPDATE … Any ideas
something like UPDATE MyTable set STOCK = (Mytable.fieldbyname(‘stock’).asInteger – dropdowncombo1.value)
dont have delphi here with me so unsure does this work on selected record in the grid…
I have a field in my database called ‘Stock’. It displays how many items
Share
This does the job …