I have a subform that checks a value in the main form. If the value is greater I get a messagebox box saying so - this works o.k. but now I want to setfocus back to this same text box and put the value back to zero before the user can change it or move on. Here is what I have but it just moves on to the next text box on the form...
If MedfrWharf > [Forms]![frmAddtoMaturing-Port au Choix]![MedTubsLeft] Then
If MsgBox("# Tubs taken can't be more than # tubs on wharf!", vbOKCancel, "Wrong # Medium Containers") = vbCancel Then
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
End If
End If
If MedfrWharf > [Forms]![frmAddtoMaturing-Port au Choix]![MedTubsLeft] Then
If MsgBox("# Tubs taken can't be more than # tubs on wharf!", vbOKCancel, "Wrong # Medium Containers") = vbCancel Then
DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70
End If
End If