ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Set Focus On ComboBox (https://www.excelbanter.com/excel-programming/413571-set-focus-combobox.html)

Minitman

Set Focus On ComboBox
 
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


JLGWhiz

Set Focus On ComboBox
 
Have you tried adding additional lines of code into the GotFocus event?

"Minitman" wrote:

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



Tim Zych

Set Focus On ComboBox
 
How does it jump to the next cell? When I mock something up, it clears the
value out and that's it.

--
Tim Zych
www.higherdata.com
Compare data in worksheets and find differences with Workbook Compare
A free, powerful, flexible Excel utility


"Minitman" wrote in message
...
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




Minitman

Set Focus On ComboBox
 
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
ToolbarFormsComboBox to a ToolbarControl ToolboxComboBox.

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


On Fri, 4 Jul 2008 19:12:00 -0700, JLGWhiz
wrote:

Have you tried adding additional lines of code into the GotFocus event?

"Minitman" wrote:

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




Minitman

Set Focus On ComboBox
 
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





On Sat, 5 Jul 2008 11:49:35 -0700, "Tim Zych"
<tzych@NOSp@mE@RTHLINKDOTNET wrote:

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




All times are GMT +1. The time now is 02:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com