combobox value disappears sometimes

  • Thread starter Thread starter rgrantz
  • Start date Start date
R

rgrantz

This is a strange behaviour:

I have several unbound combobox controls on a form. A couple have
rowsources of queries, a couple from tables. When I choose the value from
them, sometimes the value disappears from the combobox (not the value as a
choice, but the value CHOSEN, that resides in the un-pulled-down combobox
after it's chosen from the list). They work and everything, but erratically
the value in them will just be invisible. They are all set to appropriate
column widths, etc., and the value doesn't disappear all the time on a
certain few, and never on others, etc., it's all very unpredictable.

I have seen many posts about this, as far back as Access 97, but no one has
had a solution. A few ideas were things happening in the AfterUpdate code,
but I removed this code from all of them and still get this weird thing
happening. Has anyone figured out why this happens, or how to correct it?

Using Access 2000 and Windows 2000 Pro.

Thanks for any ideas.
 
A followup that will hopefully aid in the solution to this:

I notice that when the form (in continuous form view, all these comboboxes
are in the header and set the criteria for the query that is the
recordsource for the form) has records that meet the criteria chosen in the
comboboxes, then their value doesn't disappear once chosen. However, if the
criteria return no records, this is when chosen criteria disappear from the
box (essentially making it LOOK like no choice has been made yet, even
though there is actually a value sitting there that was chosen). When the
form is requeries, and there are 0 records returned, then combobox choices
don't show up after chosen until there are again records that match the
criteria. Once records show up, then selecting things from the combobox
will show that choice in the combobox. However, if the next criteria chosen
return no records again, then subsequent choices won't show up until after
they happen to return records again.

Again, the value IS being put in these comboboxes, and the query and
criteria ARE working; it's just that every occasion of choosing values with
the comboboxes will show that choice in the combobox if the previous choices
returned records, and will not show up if the previous choice showed NO
records.

What can be done about this? It seems VERY strange
 
It sounds as if the LimitToList property of your combobox is set to Yes.
That means that the combobox will only show values if they are in the
droplist.
If the query which feeds them returns no values, they will always show
blanks, even if a value has been entered.
If the combobox's Bound Column is not the column displayed in the list,
LimitToList cannot be set to No.

HTH
- Turtle
 
Back
Top