Set Focus On ComboBox

  • Thread starter Thread starter Minitman
  • Start date Start date
M

Minitman

Greetings,

I have a Toolbox ComboBox on a sheet. I need to clear its' contents
and then start typing into it to find the next match.

I tried this code to clear the contents:
__________________________________________________________

Private Sub ComboBox1_GotFocus()

ComboBox1.Text = vbNullString

End Sub
__________________________________________________________

This cleared the contents fine, but then jumped to the next cell in
the worksheet.

Is there a way to clear the contents of the ComboBox and stay in the
ComboBox until I'm finished finding the next record?

Any help will be appreciated.

-Minitman
 
How does it jump to the next cell? When I mock something up, it clears the
value out and that's it.
 
Hey JLGWhiz,

Thanks for the reply.

I don't know what to add to that GotFocus event code!
Everything I have tried has only made things worse!!!

Right now it is erroring out when I open the workbook.

Everything worked until I tried to change from a
Toolbar>Forms>ComboBox to a Toolbar>Control Toolbox>ComboBox.

The reason to try and change is that the Control Toolbox ComboBox can
be entered into, cleared and a name can be typed in with the ComboBox
using it's MatchEntry=1 - fmMatchEntryComplete property to find a
match, if any (not available with the Forms ComboBox).

It is the Control Toolbox ComboBox conversion that I am having a great
deal of problems with, GotFocus is only the first.

I am not sure how much code you need to see (if any) to direct me in
the right direction.

Any help, ideas, tricks or samples in dealing with this Control
Toolbox ComboBox would be greatly appreciated.

-Minitman
 
Hey Tim,

Thanks for the reply.

That is a good question. I'm not sure!

I think it may have something to do with what it is trying to do.

As I mentioned in my last reply, this whole problem started with
trying to change the ComboBox from the Forms ComboBox to the
Control Toolbox ComboBox.

In the Forms ComboBox, there are no events available (including
GotFocus). I was trying to find a way to clear the contents and have
that change reflect in the cells with formulas.

-Minitman
 
Back
Top