Trouble setting focus in combobox in frame control

pjbassdc

New Member
Joined
Jun 11, 2009
Messages
10
Hi All,

Little trouble getting my combobox to take focus after its frame is set to visible=true. I have some code that is suppose to change the visibility state of "Frame_Muscles" based on check listboxbox selections. If Frame_Muscles is visible, I want the focus to go directly to the combobox "cbmusclegroup"
Code snippet here:
Code:
Private Sub Frame_Mode_Exit(ByVal Cancel As MSForms.ReturnBoolean)

Dim i As Long


Frame_Muscles.Visible = False
Frame_Screw.Visible = False


For i = 4 To 16


If ListBox2.Selected(i) Then Frame_Muscles.Visible = True
Next i


If ListBox2.Selected(14) Then Frame_Screw.Visible = True


End Sub

I have tried a variety code bits to try and get the focus on "cbmusclegroup" which is a combobox within Frame_Muscles. All have failed up to this point. After the last If statement in the code, I have tried "Frame_Muscles.repaint" and "cbmusclegroup.setfocus" to get the frame visible under the correct conditions and the cursor focused before the sub exit.

Any help is appreciated,

Patrick
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

Forum statistics

Threads
1,191,215
Messages
5,985,314
Members
439,956
Latest member
venky2002

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top