Combo Box event works only once

G

Guest

have a combo box whose value is derived from a value list. Behind the After
Update I have an event procedure that references the value in the combo box
with data in another table. The first time I put data in the combo box the
code executes fine. If I then immediately change the value in the combo box
the event procedure does not fire at all. I put a stop in the code behind the
event procedure to verify this.

Why would the event procedure only work once? Thanks
 
N

nickf123 via AccessMonster.com

Eddy,

I think I ran into this problem a while back when trying to do the same type
of thing, but I can't reproduce the error at the moment.

I believe I solved this either one of two ways, I suggest trying both of them
and (hopefully) one will work:

1) At the end of your Afterupdate event, SetFocus to another control on the
form, then SetFocus back on the ComboBox. This should reset the flag that
showed a change in data, and you should be able to immediately change the
data again and re-execute the code with no problem.

2) Use the Requery function of the combobox to make sure your form sees that
the data has changed. This may or may not work, depending on what you are
doing; I used it in building a file explorer, and requeries ended up making
the comboboxes refresh properly and pass on the correct data.

Hope it helps, good luck.

-Nick
 

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

Similar Threads


Top