I have a form with a subform in my database that I use to manage deliveries. A combo box on the subform displays items of inventory and thier current status. The code behind the combo box is...
A second combo box on the same subform allows me to change the inventory status; eg: from 'Available' (1) to 'Sold' (5).
The subform allows me to display multiple items for delivery. When I select a new item for delivery I do not want to see any of the items that have a status of Sold. I have tried setting the criteria in the combo box query to InventoryStatus ID < 5 but this clears the previous entries where I set the status to Sold.
I think I need to put an 'IF New Record' statement into the combo box query. Something like...
'If new record select from Inventory where Inventory status less than 5, Else select unfiltered'.
Can someone help please
Code:
SELECT Inventory.InventoryID, Inventory.ProductCode, Inventory.SerialNumber, [Inventory Status].InventoryStatus FROM [Inventory Status] INNER JOIN Inventory ON [Inventory Status].InventoryStatusID = Inventory.InventoryStatusID;
The subform allows me to display multiple items for delivery. When I select a new item for delivery I do not want to see any of the items that have a status of Sold. I have tried setting the criteria in the combo box query to InventoryStatus ID < 5 but this clears the previous entries where I set the status to Sold.
I think I need to put an 'IF New Record' statement into the combo box query. Something like...
'If new record select from Inventory where Inventory status less than 5, Else select unfiltered'.
Can someone help please
Comment