Results 1 to 3 of 3

Thread: [RESOLVED] Help Plzzzzzzzzzzzz...

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jul 2011
    Posts
    22

    Resolved [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.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Help Plzzzzzzzzzzzz...

    Welcome to the forums

    You spelled Variant incorrectly.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jul 2011
    Posts
    22

    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.
    Last edited by Hack; Jul 26th, 2011 at 06:21 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width