Not sure how your table is set up, but you might try something like:
'--the Before Update event of one of your text boxes
tbxXL_BeforeUpdate(Cancel as Integer)
Dim sStyle as String
Dim sColor as String
Dim sSql as String
Dim iQty as IntegerDim iAmtOnHand as Integer
Dim db as Database
Dim rst as Recordset
'--get the style from the Style combo box
sStyle = cbxStyle
'--get the color from the Color combo box
sColor = cbxColor
'--get the quantity entered in this textbox
iQty = tbxXL
'--create the query from the above values - size will change for each textbox (could put this in a function that each text box calls)
sSql = "Select AmtOnHand From ColorInventory Where Style = '" & sStyle & "' and Color = '" & sColor & "' and Size = 'XL'"
'--create instances of the db and recordset
Set db = DBEngine(0)(0)
Set rst = db.OpenRecordset(sSql, dbOpenDynaset)
iAmtOnHand = rst!AmtOnHand
rst.close
set rst = nothing
set db = nothing
'check the quantities, and display a message if needed (could include color and stlye in the message)
If iAmtOnHand < iQty Then
msgbox "There are only " & iAmtOnHand & " XL shirts in inventory. " & iQty-iAmtOnHand & " will have to be backordered."
End Sub
Hope this helps.