Repost: Prevent combo box auto-dropdown after NotInList event

R

Rex Gillit

I'm using an unbound combo box as an incremental search tool with
LimitToList=Yes and Autoexpand=Yes. It does not matter to me whether the
text in the box is actually in the list or not. I'm using Response =
acDataErrContinue in the NotInList event to suppress the Access "Not in
list" dialog. However, the combo box automatically drops down. Is there any
way to prevent the automatic drop-down, or if not, a way to undrop it in
VBA?

Thanks for any advice you can offer.
 
R

Rob Oldfield

Can't figure out what you doing here, but to get rid of the dropdown just
use the SetFocus command to shift the focus onto any other control.
 
R

Rex Gillit

Thanks for the suggestion. I tried it, and it caused a continual loop back
into the NotInList event.
 
R

Rob Oldfield

Without knowing exactly what you're doing I'm guessing here but a couple of
suggestions....

Turn the LimitToList property off
Read the values you're looping through into an array and loop through that
instead
Set a variable that determines whether the NotInList event fires
....and probably best...
Post another message explaining what you're trying to achieve and find a
better way of doing it.
 
R

Rex Gillit

Thanks for the tips, Rob. I had pretty much come to the conclusion that
using the combo box as a search tool was the wrong way to go, as you suggest
in your third alternative.

Rex Gillit
 

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