Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

another combobox problem 1

Status
Not open for further replies.

krzysrb

Technical User
Jun 23, 2003
30
CA
hey all,

in my program i have combo boxes linked to the table in the DB. When i allow a user to update the values in time field which i have stored as a date/time in "hh:mm" format (24hr clock), instead of displaying 10:00 the combo box is showing 10:00:00, which is correct to the nearest second, but i dont want those 2 extra zeros. is there a way to not show those extra zeros in the boxes?

please help
vlada
 
vlada,

does this help

Format(Now, "MM/DD/YYYY HH:MM")

It will give you the date & time with no seconds

Dash
 
hey Dashley,

that will format the time, but the problem i got is that the combo box adds the two zeros when i recall a record from the DB, as i said, even if it is something like 10:00, the combo box shows 10:00:00. i tried using something similar to this, but it aint working.

any other ways around it?

thanks a lot
vlada
 
In design mode, select properties for your ComboBox control, click on DataFormat and you'll get a Property Pages window come up - select Time and then choose the exact one you want from the list

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
When u pick the data from DB then only use
format(rs.field(fieldnumber),"Hh:Mm")


Hope this helps
Vikram
 
johnwm,
i tried changing the DataFormat property, but it wouldnt let me do it at all. the error that i get is that 'the data format property is not supported for this data source'. My combo connects to the DB table via Data control. I dont know if that has anything to do with it, but i am still in deperation to make it work.

thanks a lot all
vlada
 
The plain old Data Control is a bit out-of-date. Can you use the ADODC instead?

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Try the DAO DBCombo instead "Microsoft DataList Controls 6.0"
 
Just to know.. I somehow carry the idea its better not to use those bound data controls. I always prefer doing it the down and dirty style .. am i doing something wrong here? Am i going to save my time, if i switch to these Dataaware controls? Even tho i have loads of dlls doing specific tasks for me, which i can reuse, i sometimes feel very much at HELL with them..

Thanks,
Sunil.
 
I think a lot of programmers prefer the enhanced control they get by using unbound controls and separate recordsets, at the relatively small cost of learning a little extra coding.

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
johnwm,
thanks again buddy. i switched over to ADO, and it runs perfect. * for you man.


thanks a lot all

vlada
 
You're welcome. Thank you [smile]

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top