Possibly on the AfterUpdate event of the serial control
Code:
If Len(Me.txtSerial.Text) <> 0 And Me.txtQty > 1 Then
Msgbox "You can only have a quantity of 1 for a serialized part. Please change quantity to 1"
Me.txtQty.SetFocus
End If
I chose Len and Text because it will deal with when user removes what's in the serial number control whereas I don't think other tests would - especially testing on Value.
I'm assuming the form is bound as well as other things. You didn't provide much info about it. One other thing - possibly the event should be handled at the form level, otherwise the user could simply proceed with a serial and qty> 1. In that case, code would be needed in the form's BeforeUpdate event and any action that was going to save this record would be Canceled.
Last edited by Micron; 11-14-2019 at 08:42 AM.
Reason: code correction
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.