I have the below code that is only working partially and have spent hours trying to fix to no avail, any help appreciated.
The scenario is that I have a tick box [Actioned] When I tick it I want to run an Update query [Qry_Cancelled_Update_PO_Num] that enters the current date in the date used field of tbl_PO_Numbers. If the user made a mistake, then un-ticking should run the Update Query [Qry_Cancelled_Update_PO_Num_Remove] to remove the date.
Both queries work independently perfectly but when running the code only the first part runs (entering the date) It is not removing the date if I untick the Actioned tick box.
The code is attached to the on click property of the tick box
Private Sub ACTIONED_Click()
'DoCmd.SetWarnings False
If IsNull(DLookup("[DateUsed]", "tbl_Order_Numbers")) Then
DoCmd.OpenQuery "Qry_Cancelled_Update_PO_Num"
Else
DoCmd.OpenQuery "Qry_Cancelled_Update_PO_Num_Remove"
End If
End Sub