|
-
Jul 25th, 2011, 05:17 AM
#1
Thread Starter
Junior Member
[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?
Last edited by Hack; Jul 25th, 2011 at 06:01 AM.
-
Jul 25th, 2011, 06:00 AM
#2
Re: Help Plzzzzzzzzzzzz...
Welcome to the forums 
You spelled Variant incorrectly.
-
Jul 26th, 2011, 01:30 AM
#3
Thread Starter
Junior Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|