Hi everybody
This is seshu i have small doubt in adding times to a combobox
form 00:00:00 to 23:00:59 because there are two comboboxes in my table and i want to use them as from time to to time
please some one of help me out
First, you might want to consider using a DateTimePicker control rather than a combobox. Doing it your way, each combobox will have 86,400 entries. Is that possible?
But if you're determined to load them up that way, it should be fairly simple. What about the following. (Sorry, I usually check code in VB as I go, but my PC is having problems and VB won't run so I'll just type it straight out here.)
- Dim TheTime As Date,StartTime As Date
-
TheTime = TimeValue("00:00:00") ' (I think TimeValue is the right function)
-
StartTime=TheTime
-
Do
-
ComboBox.Add Format(TheTime, "hh:nn:ss")
-
TheTime = DateAdd("s", 1, TheTime
-
Loop Until Day(TheTime) <> Day(StartTime)
-