I have a subform named frmReturnedBatches on a main form named frmCloseBatch. Basically, if a batch is being returned due to problems, the user must enter a date of return. The subform is a tabular form which allows users to enter several reasons for the return into a field named [Problem]. Therefore, the subform will only need to be filled in when the user enters a date the batch was returned. I added code to the frmCloseBatch BeforeUpdate Event Procedure as follows:
Dim strMessage As String
Dim intOptions As Integer
Dim bytChoice As Byte
If Not IsNull(DateProblemsReturned) And IsNull([Forms]![frmCloseBatch]![frmReturnedBatches].Form![Problem]) Then
strMessage = "You must enter a reason the batch is being returned."
intOptions = vbOKCancel
bytChoice = MsgBox(strMessage, intOptions, "Missing Information")
[Forms]![frmCloseBatch]![frmReturnedBatches].Form![Problem].SetFocus
Cancel = True
End If
What's happening is after I've tabed past the last field on the main form, my error message is generated and will not allow me to proceed past this point.
Help!!!
Dim strMessage As String
Dim intOptions As Integer
Dim bytChoice As Byte
If Not IsNull(DateProblemsReturned) And IsNull([Forms]![frmCloseBatch]![frmReturnedBatches].Form![Problem]) Then
strMessage = "You must enter a reason the batch is being returned."
intOptions = vbOKCancel
bytChoice = MsgBox(strMessage, intOptions, "Missing Information")
[Forms]![frmCloseBatch]![frmReturnedBatches].Form![Problem].SetFocus
Cancel = True
End If
What's happening is after I've tabed past the last field on the main form, my error message is generated and will not allow me to proceed past this point.
Help!!!