VBA combobox dropdown list folded up event.

keromero

New Member
Joined
Feb 20, 2025
Messages
18
Office Version
  1. 2016
VBA combobox dropdown list folded up event.

I want to fire a message box as soon as drop down is folded up After selection made.

Change event is not helping it keeps combobox list open during message show up.

After event neither helps it needs another trigger action.

So How could I do?

Thanks in advance
 
Hi Jaafar, trust all is fine over there with yourself.

Just found out a small issue left but I cant resolve. In reference same above,

at same userform I have 3 frames.

The message box defined above works fine within same frame objects. However If I switch another frame message box appears twice.
I feel, this is something related frame switching is triggering an initial code flow, but I can not figure out.
 
Upvote 0
Hi Jaafar, trust all is fine over there with yourself.

Just found out a small issue left but I cant resolve. In reference same above,

at same userform I have 3 frames.

The message box defined above works fine within same frame objects. However If I switch another frame message box appears twice.
I feel, this is something related frame switching is triggering an initial code flow, but I can not figure out.
Could you kindly specify the exact code you're referring to? Precision in details is essential.
 
Upvote 0
Hi Jaafar, to make it easier I have prepared a very simple sheet. Please see attached image. There are two frames in common user form.

So the scenario, the Text1 Value shall be numeric, non-null and above 0. Otherwise A message pops up to correct this.

In case, If you type anything not meeting the above and press enter or click COmboBox1 there will single message box pop-up.

However If you click TextBox2 which is binded to frame 2 (or any other object which you bind in frame 2 such as text box, combo box etc)
There will be repeating 2 message box pop ups.

Disabling either frame 2 or its objects in complete solve the issue, but this is not something I want.

Thanks and Best REgards,

**************************************

Private Sub TextBox1_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)

If Len(TextBox1) > 0 And IsNumeric(TextBox1) And TextBox1.Value > 0 Then

ComboBox1.Clear
Me.ComboBox1.Enabled = True
ComboBox1.AddItem "Option01"
ComboBox1.AddItem "Option02"
ComboBox1.AddItem "Option03"

Else

MsgBox "Enter a numeric value or a value greater than zero...", vbInformation, "Selection Utility"
Cancel = True
TextBox1.Text = ""
ComboBox1.Clear

End If
**************************************
 

Attachments

  • sample.jpg
    sample.jpg
    39.9 KB · Views: 6
Upvote 0
Coding the events of controls located inside frames is a pain.
I think the easiest way is to replace the Frames with Label controls (add a border around the labels and SpecialEffect = fmSpecialEffectEtched so they look like frames ) and then place the controls over the labels.

Alternatively, in your specific situation, you can add a second Frame inside Frame2 and then place TextBox2 inside the newly added frame. (Do the same with other controls you may have in Frame2 besides TextBox2)
 
Last edited:
Upvote 0

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