I have something wrong in my code. I want the cursor to be positioned at the control "SupplierBatch" after the message box alerts the user that they need to enter the supplier batch details. The code works as I expeceted except that the cursor go to the next control on the form istead of staying at the SupplierBatch control (textbox) What am I doing wrong?
Private Sub SupplierBatch_Exit(Cancel As Integer)
Dim strNewBatch As String
If Nz([SupplierBatch]) = "" Then
Beep
MsgBox "Supplier Batch Details MUST be entered to record this quarantine item. Please enter the Supplier Batch Details Now"
Exit Sub
Me.SupplierBatch.SetFocus
Else
strNewBatch = Me.SupplierBatch.Value
Me.SupplierBatchNumber = strNewBatch
End If
Me.QReg = Me.QID
End Sub
Private Sub SupplierBatch_Exit(Cancel As Integer)
Dim strNewBatch As String
If Nz([SupplierBatch]) = "" Then
Beep
MsgBox "Supplier Batch Details MUST be entered to record this quarantine item. Please enter the Supplier Batch Details Now"
Exit Sub
Me.SupplierBatch.SetFocus
Else
strNewBatch = Me.SupplierBatch.Value
Me.SupplierBatchNumber = strNewBatch
End If
Me.QReg = Me.QID
End Sub