Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-03-2022, 04:19 PM
grNadpa grNadpa is offline Triggering event in combo box when selection not changed Windows 10 Triggering event in combo box when selection not changed Office 2016
Advanced Beginner
Triggering event in combo box when selection not changed
 
Join Date: Mar 2022
Posts: 46
grNadpa is on a distinguished road
Default Triggering event in combo box when selection not changed

Know the solution is in this forum, just haven't been able to use the proper key words to find it.



As I want and expect, my combo box's _change() event triggers both when the client makes her first selection and upon making a different selection from that list.

But there are actions that I need to duplicate when the client enters the combo box but does not change the selection. And I cannot seem to trigger a proper event for that situation.

My change event uses the combo box's Listindex to populate three textboxes from corresponding arrays. Upon clicking my CommandButtonNext, the text boxes initialize to null for the next iteration. In most cases, they are to remain blank. But in some cases, they require repopulation. And in most of those cases, using the same data related to the last Combo Box event. So far, the only indication for that need for repopulation is when the client re-enters the combo box but does not change the selection,

I've tried using the "_Click()" event. And considered the On_Exit() event. But I don't seem to get any event invoked when the selection remains unchanged.

I am considering a rather draconian solution of creating null values in my arrays that correspond to a null value in my combo box that I would trigger upon the CommandButtonNext_Click() event. That would force the client to select anew and trigger the _change() event. But doubt that is the best solution.

Ideally, when the client enters the combo box control, it will trigger an event even when the client makes no new selection that (1) does not interfere if she does make a selection (2) recognizes the Listindex of the last selection and (3) exits the sub() if no selection has yet been made.

Last edited by grNadpa; 03-03-2022 at 04:40 PM. Reason: Adding tags
Reply With Quote
  #2  
Old 03-04-2022, 07:16 AM
grNadpa grNadpa is offline Triggering event in combo box when selection not changed Windows 10 Triggering event in combo box when selection not changed Office 2016
Advanced Beginner
Triggering event in combo box when selection not changed
 
Join Date: Mar 2022
Posts: 46
grNadpa is on a distinguished road
Default

Opted to create null entries as the first entru in the combo boxes and arrays. Then set the .ListIndex to 0 on the Command Next. I'd be interested to know whether that qualifies as "best practices". But it worked.
Reply With Quote
Reply

Tags
events, vba combobox, word2016



Similar Threads
Thread Thread Starter Forum Replies Last Post
Triggering event in combo box when selection not changed How to change font and background colors based on Combo Box selection KMan3210 Word VBA 4 12-06-2016 10:11 AM
text based on Combo box selection rosscortb Word VBA 3 03-16-2015 06:57 PM
Combo Box Content Control Calculate on selection help ciresuark Word 0 03-06-2015 01:49 PM
Triggering event in combo box when selection not changed Triggering event on hyperlink notifying user before redirecting JustAboutNoon Word VBA 3 10-16-2014 08:41 PM
How can I add hyperlink to open a word file from an excel combo box selection? mahmoudramadan Excel 0 10-20-2012 10:41 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:49 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft