Results 1 to 4 of 4

Thread: [RESOLVED] add one month to a datepicker

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2014
    Posts
    8

    Resolved [RESOLVED] add one month to a datepicker

    i have a form in visual basic 2010

    it contains 2 datepicker

    the first one is the recharge date so i will choose the date
    the second one is the expiry date so it will add automatically one month
    (seconddatepicker = firstdatepicker + one month)

    in the previous version of my app it was maded in access 2013
    i put in the textbox control source (=DateAdd("m";1;[txt_Recharge_Date]))

    but i can't use it in vb

    any help please ??

  2. #2
    Hyperactive Member
    Join Date
    Jun 2014
    Location
    Lahore, Pakistan
    Posts
    450

    Re: add one month to a datepicker

    Try this:

    Code:
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    
            DateTimePicker2.Value = DateTimePicker1.Value.AddMonths(1)
    
    
    End Sub
    Last edited by hamza.saleem; Jul 22nd, 2014 at 05:00 AM.

  3. #3

    Thread Starter
    New Member
    Join Date
    Jul 2014
    Posts
    8

    Re: add one month to a datepicker

    thank you hamza it works fine

  4. #4
    New Member
    Join Date
    Jul 2019
    Posts
    1

    Re: [RESOLVED] add one month to a datepicker

    i have a form in visual basic 2010 it contains 2 datepicker the first one is the recharge date so i will choose the date the second one is the expiry date so it will add automatically one month (seconddatepicker = firstdatepicker + text box value) it was not working in visual studio 2010 help me)

Tags for this Thread

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