Combobox problem

G

Guest

I'm having an issue with a combobox that is making no sense to me at all.

I have a form with several comboboxes/textboxes.
The values in these boxes are based on a datarowview, which is based on a
listbox.selecteditem.

When a different item is selected in the listbox, all the fields are
repopulated with the correct data.

I have 1 combobox which is acting weird.
The combobox values are populated from a table, and can contain a blank
value, or 1 of 3 other values.
The dropdown property is set to dropdown, so users can enter other values
(this is so old data from the database still displays).

When the form is populated, if the value in this combobox is old data (that
isn't in the list), and it is displayed, then when a new record is selected
in the listbox, all fields update and show the correct data, except for this
combobox, it shows the same text.

As a temporary fix, I replaced the combobox with a textbox. I left all the
code that populated it exactly the same, and it works fine...so I'm assuming
it is an issue with the actual combobox, and not with the code that is
populating it...

Where can I start to debug this problem??
TIA!
amber
 
G

Guest

"The dropdown property is set to dropdown, so users can enter other values
(this is so old data from the database still displays)."

Without actually seeing your application I would suspect that allowing this
functionality of keeping old data is the culprit. From what I gather in your
statements you want this old data to remain until the point that you change
your listbox index.

1: You could try a combobox.text = to set it to something other than the old
value. force it to update to what you want even if it isnt in the list. This
should only affect the current value and not the items included.
2: If the items in the combobox are not updating and you would like them to,
try using the combobox.clear function and then use the combobox.items.add
function to individually add the items back in that you need so that you have
a clean update.
3: put a break in your code just before the combobox is updated and step
through one by one and watch the data in the combobox. It may provide you
with a clue as to what is going on.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top