Link to home
Start Free TrialLog in
Avatar of Julio Andres
Julio Andres

asked on

Help me please vb6

Hi ... I want to correctly add the minutes and show them in list1 every 45 minutes, I have two text boxes representing hour and minutes and a textbox that represents the minutes to show, how can I do?

Dim Cada
Dim icountHora
Dim icountMin
Dim i
List1.Clear
Cada = tturnomañanacada.Text
Dim t7
Dim t23
t7 = Comboturnomañanade.Text
t23 = Comboturnomañanahasta.Text
          For icountHora = t7 To t23 - 1
             For icountMin = 0 To 50 Step Cada
     

        List1.AddItem Format(icountHora & ":" & icountMin, "hh:mm")
         Next icountMin
       Next icountHora
Avatar of Nitin Sontakke
Nitin Sontakke
Flag of India image

Could you please provide sample values for two text boxes and a partial output from the List1 that you expect to see when these values are entered. Please try to provide the the most complex of the situation that you think of.
ASKER CERTIFIED SOLUTION
Avatar of aikimark
aikimark
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Julio Andres
Julio Andres

ASKER

ohhhhhhhhhhhhhhhhhh.....thank you very much......ITS WORK.......THANK YOU SO MUCH
Time to close the question
Thank you......you help me.....best wishes...!!!!!
How can I began time with 8:00,8:45....etc the code began to 8:45 and Iwant to began in 8:00......How i do?
Sub Q_29046179()
    Dim Cada
    Dim icountHora
    Dim icountMin
    Dim i
    Dim t7
    Dim t23
    
    List1.Clear
    
    Cada = tturnomañanacada.Text
    
    t7 = Comboturnomañanade.Text
    t23 = Comboturnomañanahasta.Text
    
    i = CDate(t7 / 24)
    
    Do While i < CDate(t23 / 24)
        List1.AddItem Format(i, "hh:mm")
        i = DateAdd("n", Cada, i)
    Loop
    
End Sub

Open in new window

works......thank again!!!!!