0

Hi folks,
In My Application i have used the date function to find the difference between two date.but while executing is showing that runtime erroe 424,object required.
Can anyone plz help me fast...

This is the code i have used

Dim date1, date2 As Date
Dim diff As Long
date1 = CDate(txtDOB.Text)
date2 = Date
diff = DateDiff(DateInterval.Month, date2, date1)
MsgBox diff

plz send the answer in my email also:jithusit@gmail.com

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by Jx_Man
0

Hi folks,
In My Application i have used the date function to find the difference between two date.but while executing is showing that runtime erroe 424,object required.
Can anyone plz help me fast...

This is the code i have used

Dim date1, date2 As Date
Dim diff As Long
date1 = CDate(txtDOB.Text)
date2 = Date
diff = DateDiff(DateInterval.Month, date2, date1)
MsgBox diff

plz send the answer in my email also:jithusit@gmail.com

DateInterval.Month is for Vb.Net
FOr VB use
diff = DateDiff("m", date2, date1)

0

DateInterval.Month is for Vb.Net
FOr VB use
diff = DateDiff("m", date2, date1)

Yes, agreed.
Just post code for vb 6 in this section friend :), cause there are section for vb.net

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.