I have a form that updates a field for a table for a specific order when the form opens, now I want to apply that same update except with a 2nd criteria. Here's what I have that works on the OnLoad event.
Dim strBarsReturned As String
Dim OrderID As Long
Dim strSQL As String
strBarsReturned = 0
On Error Resume Next
OrderID = Me!NightCountOrdersSubform.Form!OrderID
strSQL = "UPDATE Inventory set Inventory.[BarsReturned] = " & strBarsReturned & " where Inventory.[OrderID] = " & OrderID
CurrentDb.Execute strSQL
Now I want to add the following code but can't get it.
"where Inventory.[BarsSold] = " & IsNull
This would go in the OnClose event. The idea is if someone blanks out the field on the form when it closes it will add a 0 to the blank records on that order for that field.