[RESOLVED] Help Plzzzzzzzzzzzz...
I am new to VB...Searching a lot , i decided to post my doubt here..Could anybody help me?
This is my program , which calculates age.
=========================
Code:
Dim days As varient
Private Sub DTPicker1_change()
Dim d_diff, m_diff, y_diff As Integer
y_diff = Year(Date) - DTPicker1.Year
m_diff = Month(Date) - DTPicker1.Month
d_diff = Day(Date) - DTPicker1.Day
If Date < DTPicker1.Value Then
MsgBox "Enter Past Date"
Else
If d_diff < 0 Then
d_diff = d_diff + days(Month(Date) - 1)
m_diff = m_diff - 1
End If
If m_diff < 0 Then
m_diff = m_diff + 12
y_diff = y_diff - 1
End If
Text1.Text = y_diff & "years," & m_diff & "month,and" & d_diff & "days"
End If
End Sub
Private Sub Form_Load()
days = Array(0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
End Sub
=================
While running I got the error message as "User-defined type not defined" and it point to the first line " days As varient" .
Pls help me solving this..Whats the error?
Re: Help Plzzzzzzzzzzzz...
Welcome to the forums :wave:
You spelled Variant incorrectly.
Re: Help Plzzzzzzzzzzzz...
Hack..
Thanks a lot..
Actually , i feel how silly was my doubt..::)
A perfect guiding like this is always helpful for me like beginners.
:wave::wave: