473,382 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

how add time from 00:00:00 to 23:59:00 to a combo box as items

seshu
156 100+
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
regards
seshu
Jan 27 '07 #1
4 1981
Killer42
8,435 Expert 8TB
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.)
Expand|Select|Wrap|Line Numbers
  1. Dim TheTime As Date,StartTime As Date
  2. TheTime = TimeValue("00:00:00") ' (I think TimeValue is the right function)
  3. StartTime=TheTime
  4. Do
  5.   ComboBox.Add Format(TheTime, "hh:nn:ss")
  6.   TheTime = DateAdd("s", 1, TheTime
  7. Loop Until Day(TheTime) <> Day(StartTime)
  8.  
Jan 27 '07 #2
seshu
156 100+
will this work for time i dont think so
if possible be some more clear
please sir
Jan 29 '07 #3
seshu
156 100+
sorry sorry its working and iam also able to make chages to code
Jan 29 '07 #4
Killer42
8,435 Expert 8TB
sorry sorry its working and iam also able to make chages to code
Glad to hear it.

When we refer to a "date" value in VB (or VBA, or Access) it quite often contains both date and time information. Can be a bit confusing at times.
Jan 29 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Shaun | last post by:
Hi, I have a table called Bookings which has two important columns; Booking_Start_Time and Booking_End_Time. These columns are both of type DATETIME. Given any day how can I calculate how many...
1
by: kumar | last post by:
Dear Friends, I need the time between the busy_end_time and the next busy_start_time. oracle has a 'Lead' function which can easily address this issue. create table t ( bst date, bet date );
3
by: Jan Schmidt | last post by:
Hi NG, i've got a mystic problem i can't solve, perhaps one of you has a good idea... i will explain with some code, so fo better understanding my probroblem: i'll use asp, but for testing the...
6
by: Kenneth | last post by:
Hello, I'm having some serious problems debugging a script that I'm trying to make work. I'm working on a form where a user can type in a time (in the format of HH:MM), and another script...
2
by: teddysnips | last post by:
To set up the problem, paste this into QA: if exists (select * from dbo.sysobjects where id = object_id(N'.') and OBJECTPROPERTY(id, N'IsUserTable') = 1) drop table . GO CREATE TABLE . ( ...
19
by: Bjørn T Johansen | last post by:
I need to sort some data based on a Time field and the times can cross both midnight and noon. As far as I can tell, there is no way to solve this without also supplying a date or am I missing...
2
by: Craig | last post by:
I am very new to access and I am trying to get a database set up to gather time data. Most, if not all of my data is in the nn:ss format or minutes and seconds. I am trying to set up a form to...
0
by: Ed Bick | last post by:
Well, I read today about how I could set the dropdown value to False to change the control from presenting a Calendar to cycling through the times. Before getting that, I developed a custom Time...
6
by: mesut | last post by:
Hi colleagues, I have a small issue. I don't know how to solve it. I'm caching a property value : True or False. I do this manually and it works. But I would like to remove the cache if the the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.