SLH
03-16-2007, 08:53 AM
Hi, Making a stock management control in Access with VBA on top.
Currently trying to use a docmd.runsql with this:
UPDATE Components _
SET Components.NumberInStock = [NumberInStock]-"1" _
WHERE (((Components.ComponentID)=[forms]![Bookings]![ComBook]![comComponentID]));
So this decreases the stock by one, when the event is called.
Problem is if i put it in VBA even before executing it, it has a paddy over the 1.
The SQL originally came from a QBE in Access. Anyone any idea of how to fix the bracketing?
Edited 19-Mar-07 by geekgirlau. Reason: insert line breaks
Currently trying to use a docmd.runsql with this:
UPDATE Components _
SET Components.NumberInStock = [NumberInStock]-"1" _
WHERE (((Components.ComponentID)=[forms]![Bookings]![ComBook]![comComponentID]));
So this decreases the stock by one, when the event is called.
Problem is if i put it in VBA even before executing it, it has a paddy over the 1.
The SQL originally came from a QBE in Access. Anyone any idea of how to fix the bracketing?
Edited 19-Mar-07 by geekgirlau. Reason: insert line breaks