Results 1 to 8 of 8

Thread: Date Problem..Little further

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    20
    I have two maskeditboxes side by side with a mask of ##/##/##
    I have the following code behind a command button
    Dim StartDay As String
    Dim Endday As String
    'fill variables
    StartDay = effdate.Text
    Endday = expdate.Text
    Endday = DateAdd("y", 365, StartDay)

    When I click the button nothing happens...This may be due to they are maskeditboxes but im not sure please help...

  2. #2
    Guest
    At first: the maskeditbox from microsoft don't work correctly

    Correct Code

    dim StartDay as date,EndDay as date

    startday=cdate(effdate.text)
    endday=dateadd("y",1,startday)

    expdate.text=endday

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    20
    I get an error message invalid property value on
    expdate.Text = EndDay

  4. #4
    Guest

    i found the error


    expdate.text=format(endday,UserFormat)

    UserFormat is the same format then the format of the MaskEdit- Control

    example: MaskEdit Format dd.mm.yyyy then Userformat dd.mm.yyyy

    all ok

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    20
    Did you try it? It still doesnt put it one year ahead...10/10/00 goes to 10/11/01 I cant figure out why

  6. #6
    Guest
    what date should be in the second MaskEditbox ??
    The last day of this year or your start date + one year ??

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Posts
    20
    Start date plus one year...Its almost doing it..but it is usally one day later then the correct one
    like i enter 10/10/00
    and then the second box shows 10/11/01
    need it to be 10/10/01

  8. #8
    Guest

    Answer

    then make EndDay=EndDay-1

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