The query that you have for checking the inventory seems to be correctly formed to me, but it will not do what you are looking to do. You are currently just filtering based on the posted quantity, this will give you a result set that contains all of the records from the lamps table where the inventory is greater than the entered quantity. This is not what you need here, you need to specifically know if the quantity exceeds the inventory for the given item.
This means that your query will need to be filtered on the posted quantity and the posted item id. Once you have the query filtering on these posted values you can then add in some code to check to see if there are any rows in the recordset, if there is then you have the available inventory. You will need to test out the query on the page to ensure that it is working properly before you can do anything based on the results of the query. I would suggest that you put the rs on a new test page with the same form on the page. You should print out values from the recordset like the item id and the inventory to ensure that it is working.
If you have any trouble with this post back with this test page you are using and I can look into any problems.