Hi,
I've built a database that records samples sent out by our business and monitors stock levels accordingly.
The user input form for dealing with samples requests is built over a cascade of combo boxes which go from sample type>product range>item>colour, once colour is selected the form finds the unique ID which correlates to a stock level monitor.
As standard, my cascaded combo boxes refer to several queries with the following form:
Private Sub Product_AfterUpdate()
Me.Item = Null
Me.Item.Requery
Me.Item = Me.Item.ItemData(0)
End Sub
The queries increase in complexity to select the right records, the colour query looks like this:
SELECT DISTINCT Products.[Colour Name], Products.[Sample Type], Products.Product, Products.Item
FROM Products
WHERE (((Products.[Sample Type])=forms![Order Details]![Sample Type]) And ((Products.Product)=forms![Order Details]!product) And ((Products.Item)=forms![Order Details]!Item));
Some sample types do not need detail from every combo box (if the user chooses 'folder' from sample type, then there is no need to enter colour etc.) so I would like the form to only require further input when necessary.
The form will autofill a combo box if the prior combo box has been manually filled, but I'd like this to all be automated so that the user can select an item which doesn't require colour input and have the unique Id filled automatically to avoid a clunky interface.
I figure the way out might be some kind of 'if' command which updates the unique ID and stock if the sample type is 'folder', is there a way to do this via VBA or a query?
Or is there a way to make all comboboxes auto-update with no user input?
Thanks