I’m trying to set a code to an event procedure of a textbox (Date/Time) that will alert the user when the date entered is greater than today and return the focus to the textbox for correction. Here’s what I used. It pops up the message box, but does not set the focus back to the textbox. Here’s the code
Private Sub DateOnset_LostFocus()
If Me.DateOnset > Date Then MsgBox ("mmmm"), vbOKOnly
Me.DateOnset.SetFocus
End Sub
Private Sub DateOnset_LostFocus()
If Me.DateOnset > Date Then MsgBox ("mmmm"), vbOKOnly
Me.DateOnset.SetFocus
End Sub