Results 1 to 17 of 17

Thread: [RESOLVED] Increase/Decrease the time in a text box

  1. #1

    Thread Starter
    Frenzied Member TomGibbons's Avatar
    Join Date
    Feb 2002
    Location
    San Diego, CA Previous Location: UK
    Posts
    1,345

    [RESOLVED] Increase/Decrease the time in a text box

    I want to increase the mins/hours/seconds in a text box which holds the time. How is this done?

    Thanks
    Last edited by TomGibbons; Oct 17th, 2002 at 11:15 AM.

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Use a Timer...
    VB Code:
    1. Private Sub Timer1_Timer()
    2.     Text1.Text = Format$(Now,"hh:mm:ss")
    3. End Sub

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    Frenzied Member TomGibbons's Avatar
    Join Date
    Feb 2002
    Location
    San Diego, CA Previous Location: UK
    Posts
    1,345
    No, I want to change it. It is an input. I want to have a button to make the hours/mins increase or decrease. Thanks though

  4. #4

  5. #5

    Thread Starter
    Frenzied Member TomGibbons's Avatar
    Join Date
    Feb 2002
    Location
    San Diego, CA Previous Location: UK
    Posts
    1,345
    Well ok, a label then. Whatever...can it be done?

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    yep, use the DateAdd function (see VB help for the various parameters you can use)

  7. #7

  8. #8
    Junior Member
    Join Date
    Oct 2002
    Posts
    17
    Originally posted by TomGibbons
    No, I want to change it. It is an input. I want to have a button to make the hours/mins increase or decrease. Thanks though
    use updown and text controls to reslove it?

  9. #9

  10. #10

    Thread Starter
    Frenzied Member TomGibbons's Avatar
    Join Date
    Feb 2002
    Location
    San Diego, CA Previous Location: UK
    Posts
    1,345
    Originally posted by si_the_geek
    yep, use the DateAdd function (see VB help for the various parameters you can use)
    This can be used for time?

  11. #11
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    yep - you can use years, days, hours, seconds, etc etc...

  12. #12

    Thread Starter
    Frenzied Member TomGibbons's Avatar
    Join Date
    Feb 2002
    Location
    San Diego, CA Previous Location: UK
    Posts
    1,345
    Originally posted by si_the_geek
    yep - you can use years, days, hours, seconds, etc etc...
    umm can you please give me an example how?

  13. #13
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974
    This will add 32 seconds to "my_date":

    my_date = dateadd("s",32,my_date)

    see VB help for the list of parameters you can use

  14. #14

    Thread Starter
    Frenzied Member TomGibbons's Avatar
    Join Date
    Feb 2002
    Location
    San Diego, CA Previous Location: UK
    Posts
    1,345
    Originally posted by si_the_geek
    This will add 32 seconds to "my_date":

    my_date = dateadd("s",32,my_date)

    see VB help for the list of parameters you can use
    Thanks, I'll be home in about an hour so I'll try it then.

  15. #15

  16. #16

    Thread Starter
    Frenzied Member TomGibbons's Avatar
    Join Date
    Feb 2002
    Location
    San Diego, CA Previous Location: UK
    Posts
    1,345
    Originally posted by Wokawidget
    I am confused...
    Why go through all that trouble when there is a VB control that has already been invented that will do exactally what you want...?

    Woka
    Oops, I didnt notice your post. Cheers woka, thats perfect

  17. #17

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