Advertisement
Guest User

Untitled

a guest
Apr 21st, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.42 KB | None | 0 0
  1.  
  2.     Private Function checkDate(aCtrl As TextBox) As Date
  3.         Dim aDate As Date
  4.         While Date.TryParse(aCtrl.Text, aDate) = False
  5.             If Date.TryParse(InputBox("Please re-enter date. Entry has to be a valid date", "Error"), aDate) = True Then
  6.                 aCtrl.Text = aDate
  7.             Else
  8.                 aCtrl.Text = ""
  9.             End If
  10.  
  11.         End While
  12.         Return aDate
  13.     End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement