Time + 45 minutes?

  • 13 years ago

    Private Sub Command1_Click()

    Text1.text = "Your dinner will be ready at about " & Time + 00:45:00

    End Sub

    (this doesnt work tho)

    Could somebody help me with this, i just need to know how i can put the time in a textbox added with 45 minutes.

    thanks a lot for your time

  • 13 years ago

    Try:
    Text1.text = "Your dinner will be ready at about " & DateAdd(DateInterval.Minute, 45, Now)

  • 13 years ago

    hmm.. it doesnt work, it says : "Object required"

    please help me.

  • 13 years ago
    If you just dragged a textbox onto the form its probably called TextBox1 not Text1
  • 13 years ago

    No , the name is text1  ;).

    Still doesnt work. any other alternative, or maybe an example?

    using vb6.0

    thanks.

  • 13 years ago
    You've inadvertantly posted this thread in the .Net forum so I gave you .Net syntax.  instead of DateInterval.Minute you need to use "m" or something like that.  Just do a Google search for DateAdd in VB6
  • 13 years ago

    ah i now see im wrong here, using vb6.0.. ^.^'

     

    Thanks a lot anyway

  • 13 years ago
    It's been a while since I have used VB6, but try this:

    text1.text= "Your dinner will be ready at about " & dateadd(n,45,now)
    ' n represents minutes
    ' 45 obviously means add 45 minutes
    ' now is the constant for the current system time






Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Programs must be written for people to read, and only incidentally for machines to execute.”