473,398 Members | 2,812 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,398 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 1982
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.