Hello
I am taking input of 2 date as mm/dd/yy format in txtdate1.text and txtdate2.text
Here is the validation I am taking
VB Code:
If ((chkdate(txtdate1.Text) = False) Or (chkdate(txtdate2.Text) = False)) Then MsgBox "Invalid Date Input.. Please input in the format mm/dd/yy", vbCritical, "Invalid Date"
the chkdate() function is doing the validation as
VB Code:
Public Function chkdate(strdate As Date) As Boolean If IsDate(strdate) Then If strdate Like Format("##/##/##", "mm/dd/yy") Then chkdate = True Else chkdate = False End If Else chkdate = False End If End Function
But even if the date is entered correct it gives error msgbox
what is wrong in code.. please help
also please give me a code which can check that 1st date is lesser than 2nd date inserted
thanks![]()




Reply With Quote