clear combo box selection

J

javablood

I am using two combo boxes in a form (Form1) to update records in a table.
cbo1 contains a list of names that are incorrect and cbo2 contains the
correct names. I use an update query (SQL) using the selected names from
cbo1 & cbo2. I then have a popup form (Form2) (in dialog mode) to ask
whether additional records require updating. I requery cbo1 to make the list
current and all is working but . . . when Form2 closes and Form1 is restored
the last selection in cbo1 is still there. I have tried numerous 'fixes'
from the discussion groups to 'clear' the selection but to no avail.

Any help is much appreciated.

Thanks,
 
M

Maurice

I don't know which fixes you have used but it seems that you explicitly have
to requery the first combo on the first form when you close the seond form.
Habe you tried that?
 
J

javablood

Maurice,

I have tried:

1. requerying cbo1 from Form2 just before closing Form2 and restroing Form1
2. requerying cbo1 in Form1 After Update
3. requerying cbo1 in cbo1 After Update
4. requerying cbo1 in cbo1 On Change
5. requerying cbo1 in Form1 On Got Focus

I thought any or all of these should work but cbo1 still retains the last
selection when Form1 is restored. One note though, the requery works and in
fact even though the last selection is shown in cbo1, the pull down list does
not have it (and should not). Is this basically a ghost image that I have to
live with or is there any way to clear cbo1 so it is blank until one uses the
pull down list ?

thanks,
 
J

javablood

After much searching and many experiments at where to put the Requery, etc.,
I found a 2005 entry that used Me.cbo1 = Null so I put that line after my
Requery line, from which both followed an update query and it works fine!

thanks,
 

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