Quirk selects invisible ComboBox when clicking nearby visible Command Button

AnthK

New Member
Joined
Nov 1, 2022
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
Hi everyone.
I have an issue that I have been trying to figure out and it seems to be a bug in excel maybe?

So I have a userform which displays a heap of data from a Table that is located on a worksheet.
The user selects a record through a series of ComboBoxes.
Once chosen - those ComboBoxes are made invisible and the data is displayed (other controls become visible)
The data includes command buttons which will allow the user to click to select a new related record.
The command button essentially reloads the data in the ComboBoxes while they are invisible to display the new record.
The only issue is that when the new record is displayed - the invisible ComboBox that was located on top of the command button will be displayed with its selected value.
I then need to click somewhere on the userform to get it to disappear.

So I assume that there is something going on here due to the Z-order given that the controls occupy the same space on the form but I would have thought that being invisible - the control shouldn't be able to be displayed?

If anyone has any previous experience with this or thoughts I would love to hear!

Thanks,

Anthony
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Sorry I should clarify - when I say that the invisible ComboBox is displayed - it only displays the currently selected item from the listbox component. The textbox component and all other entries of the listbox are not visible - just the element that has (for example) ComboBox1.Selected(4) = True.
I have forced the visible property = true then false but all that happens is it displays the rest of the ComboBox then hides it again - still with the selected value!
 
Upvote 0
I've never seen this behaviour. If it's only with one combo, try increasing the list width property (it may be 0 at present) or leave it at 0 and increase the control width. I think the z order shouldn't matter if controls in the stack are invisible. You could also try setting the focus to some other control or perhaps try userform.Repaint
 
Upvote 0

Forum statistics

Threads
1,225,619
Messages
6,186,045
Members
453,335
Latest member
sfd039

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
Back
Top