Results 1 to 6 of 6

Thread: Looks Tough.. Date problem

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    20
    I have two text boxes side by side. The user enters in a date in the first box in ##/##/## format. When they tab to the next box I would like it to autopopulate with a date 365 calender days from the first box..Any help would be awesome.>Thanks
    Adam

  2. #2
    Guest
    if you have VB6 then use the DTPicker- control or the MonthView control from the Microsoft Windows Common Controls-2 6.0

  3. #3
    Hyperactive Member
    Join Date
    May 2000
    Location
    Or
    Posts
    316
    Give this a try:

    Code:
    Private Sub Command1_Click()
    myDate = CDate(Text1.Text)
    Text2.Text = DateAdd("d", 365, myDate)
    End Sub
    Hope this helps.

  4. #4
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Columbia, SC USA
    Posts
    374
    reeset, two things:

    1) thank you for showing me a new function! never knew about the DateAdd

    2) it should actually read
    Code:
    Text2.Text = DateAdd("d", 366, myDate)
    you have the number 365, and that makes it show a value of exactly one year minus one day ahead of the passed value.

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    20
    will it matter if the text boxes are masked edit boxes??

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    20
    Yeah its not working I think because they are masked edit boxes with a mask of ##/##/## anymore help please????

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