Uncle, I can't figure this out. I have a form with multiple subforms. On subformA, I want to make sure that if the user checks the control "MatchProject", that they have made an entry in the "MatchingGrant" field. The code to do the validation is working fine, but I want to force the user to go back to either uncheck the box or put a value in "MatchingGrant" before they can move on to another field. This part on BeforeUpdate for the subform works fine:
'If [MatchProject] = -1 And IsNull(MatchingGrant) Then
MsgBox "You must enter a matching grant or unselect Match Project"
But, neither of the below code actually takes curser back to the "txtMatchingGrant" field. It doesn't generate an error, it just doesn't change the focus. I've tried first doing setfocus on the subform then either setfocus or gotocontrol to go back to "txtMatchingGrant"... but it just doesn't do anything. The focus stays wherever I put it when I clicked outside SubformA. Any help would be appreciated.
Forms!frmCOEACtivities.Enter_Funding_Source_s_.Set Focus
DoCmd.GoToControl "txtMatchingGrant"
Me.txtMatchingGrant.SetFocus