A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Combobox time



 
 
Thread Tools Display Modes
  #1  
Old September 18th, 2009, 09:20 PM posted to microsoft.public.access.tablesdbdesign
Billiam
external usenet poster
 
Posts: 174
Default Combobox time

I have a reference/lookup table named StartTime, StartTimeID PK, autonumber,
with field StartTime (format date/Time, medium time format)

I bulit a form on t-employees with a subform t_timesheet.

Simply, I added a bound combobox lookup which displays the time as entered
in the lookup/reference table as 7:30 am (medium time).

When I select this from the combo box, I get the message that the value is
in the wrong format...

I checked the field it is bound to t-timesheet field StartTime, it is format
date/Time, medium time, I checked the lookuptable, it is date/Time meium time
format. values that had been in the table prior to changing to a combobox
dropdown now include seconds (which is Long time, which i did not choose
anywhere). In other words, instead of it saying 7:30 am as it should, it is
displaying 7:30:00 am.

Can anybody help me with this?
many thanks,

Billiam
  #2  
Old September 18th, 2009, 09:33 PM posted to microsoft.public.access.tablesdbdesign
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Combobox time

I expect your combo box might be bound to the AutoNumber field. If this is
the case, you shouldn't attempt to store it in a date/time field. Don't get
hung up on how a datetime value is stored. Every datetime field is store in
exactly the same way. It's a float number where the whole number portion is
the number of days since 12/30/1899 and the decimal part is the portion of
the day. For instance .25 is 6:00 AM.

What caused someone to create a lookup table for the time entry with an
Autonumber?
--
Duane Hookom
Microsoft Access MVP


"Billiam" wrote:

I have a reference/lookup table named StartTime, StartTimeID PK, autonumber,
with field StartTime (format date/Time, medium time format)

I bulit a form on t-employees with a subform t_timesheet.

Simply, I added a bound combobox lookup which displays the time as entered
in the lookup/reference table as 7:30 am (medium time).

When I select this from the combo box, I get the message that the value is
in the wrong format...

I checked the field it is bound to t-timesheet field StartTime, it is format
date/Time, medium time, I checked the lookuptable, it is date/Time meium time
format. values that had been in the table prior to changing to a combobox
dropdown now include seconds (which is Long time, which i did not choose
anywhere). In other words, instead of it saying 7:30 am as it should, it is
displaying 7:30:00 am.

Can anybody help me with this?
many thanks,

Billiam

  #3  
Old September 18th, 2009, 09:55 PM posted to microsoft.public.access.tablesdbdesign
Billiam
external usenet poster
 
Posts: 174
Default Combobox time

Hi Duane,

To answer your question, i'm betting the answer is, *politely*, inexperience?

Simply, I am trying to make it as easy as possible for someone to enter
their timesheet info...i thought creating the combobox from a lookup table
was a good idea...of course I forgot the autonumber ID is being stored...not
the 'time"
So I fixed that and everything works now.

Is it wrong to store the ID field with time...I thought that is what you are
supposed to do with a combobox? I realize each time is unique and could be
used as it's own PK, but habit just made me do it with an autogenerated PK.
Looking at this now, i suppose i could accidently enter in 11:30 am twice. Is
this the point you are making?

I'm afraid I am not very good at this. BTW I am using Access 2007.

Billiam

"Duane Hookom" wrote:

I expect your combo box might be bound to the AutoNumber field. If this is
the case, you shouldn't attempt to store it in a date/time field. Don't get
hung up on how a datetime value is stored. Every datetime field is store in
exactly the same way. It's a float number where the whole number portion is
the number of days since 12/30/1899 and the decimal part is the portion of
the day. For instance .25 is 6:00 AM.

What caused someone to create a lookup table for the time entry with an
Autonumber?
--
Duane Hookom
Microsoft Access MVP


"Billiam" wrote:

I have a reference/lookup table named StartTime, StartTimeID PK, autonumber,
with field StartTime (format date/Time, medium time format)

I bulit a form on t-employees with a subform t_timesheet.

Simply, I added a bound combobox lookup which displays the time as entered
in the lookup/reference table as 7:30 am (medium time).

When I select this from the combo box, I get the message that the value is
in the wrong format...

I checked the field it is bound to t-timesheet field StartTime, it is format
date/Time, medium time, I checked the lookuptable, it is date/Time meium time
format. values that had been in the table prior to changing to a combobox
dropdown now include seconds (which is Long time, which i did not choose
anywhere). In other words, instead of it saying 7:30 am as it should, it is
displaying 7:30:00 am.

Can anybody help me with this?
many thanks,

Billiam

  #4  
Old September 19th, 2009, 01:49 AM posted to microsoft.public.access.tablesdbdesign
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Combobox time

If I wanted to create a combo box for time entry, I would probably use a
generic function that returns time values from a start to end time and with a
specific minute interval. A decent alternative is a lookup table but it
wouldn't be quite as flexible.
--
Duane Hookom
Microsoft Access MVP


"Billiam" wrote:

Hi Duane,

To answer your question, i'm betting the answer is, *politely*, inexperience?

Simply, I am trying to make it as easy as possible for someone to enter
their timesheet info...i thought creating the combobox from a lookup table
was a good idea...of course I forgot the autonumber ID is being stored...not
the 'time"
So I fixed that and everything works now.

Is it wrong to store the ID field with time...I thought that is what you are
supposed to do with a combobox? I realize each time is unique and could be
used as it's own PK, but habit just made me do it with an autogenerated PK.
Looking at this now, i suppose i could accidently enter in 11:30 am twice. Is
this the point you are making?

I'm afraid I am not very good at this. BTW I am using Access 2007.

Billiam

"Duane Hookom" wrote:

I expect your combo box might be bound to the AutoNumber field. If this is
the case, you shouldn't attempt to store it in a date/time field. Don't get
hung up on how a datetime value is stored. Every datetime field is store in
exactly the same way. It's a float number where the whole number portion is
the number of days since 12/30/1899 and the decimal part is the portion of
the day. For instance .25 is 6:00 AM.

What caused someone to create a lookup table for the time entry with an
Autonumber?
--
Duane Hookom
Microsoft Access MVP


"Billiam" wrote:

I have a reference/lookup table named StartTime, StartTimeID PK, autonumber,
with field StartTime (format date/Time, medium time format)

I bulit a form on t-employees with a subform t_timesheet.

Simply, I added a bound combobox lookup which displays the time as entered
in the lookup/reference table as 7:30 am (medium time).

When I select this from the combo box, I get the message that the value is
in the wrong format...

I checked the field it is bound to t-timesheet field StartTime, it is format
date/Time, medium time, I checked the lookuptable, it is date/Time meium time
format. values that had been in the table prior to changing to a combobox
dropdown now include seconds (which is Long time, which i did not choose
anywhere). In other words, instead of it saying 7:30 am as it should, it is
displaying 7:30:00 am.

Can anybody help me with this?
many thanks,

Billiam

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:53 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.