G
Guest
I am trapping for a duplicate Container number. After the error is trapped I want to set the focus back to the field (Container) that has the duplicate value. This is written in Access 97. The problem is that the focus does not return to the appropriate field. The following is the code
Select Case Err.Numbe
Case 302
' Container # is a duplicat
strMSG = "Container #" & Me.Container & " is a duplicate." & Chr(10
strMSG = strMSG & "Please input a different Container #.
strOpt = vbOKOnl
strTtl = "ERROR-DUPLICATE CONTAINER #
strRes = MsgBox(strMSG, strOpt, strTtl
' Set the focus back to the Container fiel
* This is the problem area. It advances to the next field on the sub-form instea
* of returning focus to the container field
Forms!frmMemoHdr!frmMemoDetail.Form!Container.SetFocu
Case Els
MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical, cstrProcNam
End Selec
GoTo ExitHer
Select Case Err.Numbe
Case 302
' Container # is a duplicat
strMSG = "Container #" & Me.Container & " is a duplicate." & Chr(10
strMSG = strMSG & "Please input a different Container #.
strOpt = vbOKOnl
strTtl = "ERROR-DUPLICATE CONTAINER #
strRes = MsgBox(strMSG, strOpt, strTtl
' Set the focus back to the Container fiel
* This is the problem area. It advances to the next field on the sub-form instea
* of returning focus to the container field
Forms!frmMemoHdr!frmMemoDetail.Form!Container.SetFocu
Case Els
MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical, cstrProcNam
End Selec
GoTo ExitHer