Combobox date/time value notinlist event

  • Thread starter Thread starter Silvester
  • Start date Start date
S

Silvester

Can someone please help me with code that can handle a combobox filled with
date/time values that will fire the notinlist event and and a new date/time
if it does not exist.
 
Silvester

I'm not at all clear what you are trying to accomplish. You've described a
"how" you are trying to do something, but I'm not even that clear on the
how...

Are you saying you want a NotInList event to fire when someone enters a
value not in the combo box's list? If so, check Access HELP for NotInList.
 
I have a combobox filled with standard meeting timings eg: 9:30 AM, 2:30 PM
etc

If an user enters any new timing I would like to add that new timing to the
combobox list. This be able to recognise even if the user enters a time in
12 or 24hr formats

How can I achieve this ?
 
Silvester

A combo box may be based on an underlying table, or on a list. If your
combo box is based on a list, you will have to work harder to add a new
value.

If your combo box is based on a lookup table, you can use the combo box's
NotInList event to add a new item to that underlying table and then requery
the combo box, revealing the new addition.

You didn't mention what the underlying field's data type is, so it's tough
to speculate about what form your new data must take.
 
I have a combobox filled with standard meeting timings eg: 9:30 AM, 2:30 PM
etc, stored in a table. So its a combobox based on a lookup table.

If an user enters any new timing I would like that new timing to be added
to the combobox list (i guess through dao recordset). This should be able to
recognise even if the user enters a time in 12 or 24hr formats. I do not use
input masks in the combobox.

How can I achieve this using limitolist & notinlist ?

I have been able to get this to work with strings but not with date/time
values...
 
Silvester

A potentially complicating factor has to do with the fact that even though
your field appears to hold "9:30 AM", it actually hold a date and a time.

Perhaps you are trying to store time-only in a date/time field?
 
Silvester

If you are intending only to show/display what appears to be a time (e.g.,
9:30 AM), you could use a text data type. A similar situation happens when
folks try to store a US ZipCode as a number -- if you aren't doing any
calculations on it, it's text!

If you aren't doing any date/time operations on "9:30 AM", it's text!

Good luck

Jeff Boyce
<Access MVP>
 
Back
Top