Results 1 to 4 of 4

Thread: [RESOLVED] september 2009 - 3months= june

  1. #1

    Thread Starter
    Member kirara22's Avatar
    Join Date
    Feb 2009
    Posts
    54

    Resolved [RESOLVED] september 2009 - 3months= june

    hi guys..

    how would i subtract date of the following example:

    text1= september 2009
    text 2= 3
    answer = june 2009


    september 2009 - 3months= june 2009


    im a student btw and working for my thesis...

    tnx n advance..
    Last edited by Hack; Mar 11th, 2009 at 11:50 AM. Reason: Added RESOLVED to thread title and green resolve checkmark

  2. #2

  3. #3
    Fanatic Member
    Join Date
    Mar 2009
    Posts
    804

    Re: september 2009 - 3months= june

    Perhaps something like:
    Code:
    Private Sub Form_Load()
     Dim d As Date
     d = DateSerial(2009, 9, 1)
     txtDate.Text = Format$(d, "mmmm yyyy")
    End Sub
    Private Sub cmdSubtract_Click()
     Dim d As Date
     Dim M As Long
     M = Val(txtMonths.Text)
     If M Then
      d = CDate(txtDate.Text)
      txtRes.Text = Format$(DateAdd("m", -M, d), "mmmm yyyy")
     End If
    End Sub

  4. #4

    Thread Starter
    Member kirara22's Avatar
    Join Date
    Feb 2009
    Posts
    54

    Re: september 2009 - 3months= june

    tnx..

    specially to

    VBClassicRocks u have me a lot.

    tnx and more power

    im really new at vb.. hehe..


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