473,396 Members | 2,018 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,396 software developers and data experts.

Time and combo box

1
Can any one help me im trying to populate a combo box in vb6 with the time form 0 hours to 24 hours for the hole day so wood say it in hh:mm.
thanks
Apr 28 '06 #1
2 2240
Try "format" function to change the formats of time,date or numbers

combobox name is "cboTime"

For i = 0 to 24
cboTime.additem format(ctime(i),"hh:mm")
Next

may be it show the error in "ctime", if it is show the error remove the ctime and just put "i"
Feb 3 '07 #2
Killer42
8,435 Expert 8TB
You could try this one, as well...
Expand|Select|Wrap|Line Numbers
  1. Dim TheTime As Date, I As Long
  2. TheTime = TimeValue("00:00")
  3. For I = 1 To 1440
  4.   cboTime.AddItem Format(TheTime, "hh:nn")
  5.   TheTime = DateAdd("n", 1, TheTime)
  6. Next
  7. cboTime.Text = "00:00"
Feb 4 '07 #3

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

Similar topics

2
by: kk | last post by:
Have 2 problems, any help is appreciated. Tab with Grids -------------- BL - fetching data from DB ( 5 secs - 10 rows) Grid Laod - 20 secs Grid Paint on tab change - 20 secs Problem: The...
1
by: Andrew Parsons | last post by:
Apologies if this is an old chestnut, but I can't find an answer anywhere! I have a form which has a button which opens a report. This all works perfectly well. However, I am trying to set up a...
6
by: Rebecca Smith | last post by:
Today’s question involves two time text boxes each set to a different time zone. Initially txtCurrentTime will be set to Pacific Time or system time. This will change with system time as we travel...
5
by: Rated R1 | last post by:
I wrote this before in the NGs, so I am going to paste the responses that I got and see if someone can please help me. Email me and we can set something up as Id even be willing to pay for your...
5
by: jcrouse | last post by:
Many of you who may respond to this are somewhat familiar with my app in process (Cor). Simply, it's a form with 30 labels that is triggered from another application, with a hotkey. The labels text...
3
by: Shawn Yates | last post by:
I have a database that I am using as a Time clock where employees can clock in and out. Is there a way to make it so that when they clock out a form would open displaying their work day hour by...
1
by: sangram | last post by:
how to select a default value of combo box in run time, i have select some value from database ,depending on this i have to set the value of combox box... advance thanks..
1
by: Akinyemi | last post by:
I created a Database which I named "Address". I went through the Control Panel and created a DSN to enable me connect to the Database through ODBC. I then created a Form with the same fields as...
1
by: AA Arens | last post by:
I do have a field with fields. One one them is a combo box and a two fields that needed to be filled with date and time. How to perform that the latter fields are filled direct after a value...
6
by: mysore | last post by:
I am using VB6.0 I have two combo boxes , namely combo1 and combo2. For E.g, I say Combo1.AddItem Combo1.Text to add a new item to the list during run time. In the drop down I do see the new item...
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: 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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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,...

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.