You have to construct the query in a string variable and populate it with the values from the form controls you reference.
The following code assumes that the part number and lot number fields in the table are numeric datatypes
Code:
Dim mySQL As String
mySQL = "UPDATE tblInventoryInfo SET tblInventoryInfo.StockLevel= tblInventoryInfo.StockLevel-" & Me.Qty
mySQL = mySQL & " Where tblInventoryInfo.PartNumber=" & Me.PartNumber & " AND tblInventoryInfo.LotNumber=" & Me.LotNumber
CurrentDb.Execute mySQL, dbFailOnError
If the part and lot number fields are text fields, the code would look like this:
Code:
Dim mySQL As String
mySQL = "UPDATE tblInventoryInfo SET tblInventoryInfo.StockLevel= tblInventoryInfo.StockLevel-" & Me.Qty
mySQL = mySQL & " Where tblInventoryInfo.PartNumber='" & Me.PartNumber & "' AND tblInventoryInfo.LotNumber='" & Me.LotNumber & "'"
CurrentDb.Execute mySQL, dbFailOnError