Quantcast
Channel: Excel IT Pro Discussions forum
Viewing all articles
Browse latest Browse all 11829

Validation causing error when form is cleared

$
0
0

Private Sub txtEstStartDate_Exit(ByVal Cancel As MSForms.ReturnBoolean)
  If Not IsDate(txtEstStartDate) Then
      MsgBox "Input must be a date in the format: 'mm/yyyy'"
      Cancel = True
   Else
     txtEstStartDate = Format(txtEstStartDate, "mmm/yyyy")
   End If
       Me.txtEstStartDate.SetFocus
End Sub

This throws an error when I clear the form, the debugger goes to the setfocus line? how do I get around this?

thanks for any help


Viewing all articles
Browse latest Browse all 11829

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>