I have a form with 3 controls boudn to the following fields:
DPBatchNumber - textbox where the company batch details are recorded.
SupplierBatchNumber - textbox where the supplier's batch info is recorded
SupplierBatch - query control where either the DPBatchNumber or the SupplierBatchNumber is stored on the for for users.
The SupplierBatchNumber field is a required field.
I have the following code written. The first part works, but after the user enters data in the input box the cursor moves to the correct control, but I cannot edit the control (SupplierBatch). It is behaviing like it is locked, but it is not locked. Can someone tell me what I am doing wrong?
=================================================
Private Sub SupplierBatch_Exit(Cancel As Integer)
Dim strNewBatch As String
Dim stUserInput As String
If Nz([SupplierBatch]) = "" Then
stUserInput = InputBox("Supplier Batch Details MUST be entered to record this quarantine item. Please enter the Supplier Batch Details Now", "Supplier Batch Details")
Me.DPBatchNumber.SetFocus
Me.SupplierBatch.SetFocus
Me.SupplierBatch = stUserInput
Else
strNewBatch = Me.SupplierBatch.Value
Me.SupplierBatchNumber = strNewBatch
End If
Me.QReg = Me.QID
End Sub
DPBatchNumber - textbox where the company batch details are recorded.
SupplierBatchNumber - textbox where the supplier's batch info is recorded
SupplierBatch - query control where either the DPBatchNumber or the SupplierBatchNumber is stored on the for for users.
The SupplierBatchNumber field is a required field.
I have the following code written. The first part works, but after the user enters data in the input box the cursor moves to the correct control, but I cannot edit the control (SupplierBatch). It is behaviing like it is locked, but it is not locked. Can someone tell me what I am doing wrong?
=================================================
Private Sub SupplierBatch_Exit(Cancel As Integer)
Dim strNewBatch As String
Dim stUserInput As String
If Nz([SupplierBatch]) = "" Then
stUserInput = InputBox("Supplier Batch Details MUST be entered to record this quarantine item. Please enter the Supplier Batch Details Now", "Supplier Batch Details")
Me.DPBatchNumber.SetFocus
Me.SupplierBatch.SetFocus
Me.SupplierBatch = stUserInput
Else
strNewBatch = Me.SupplierBatch.Value
Me.SupplierBatchNumber = strNewBatch
End If
Me.QReg = Me.QID
End Sub