Tab in/out of object vs mouse click

chappy68

Registered User.
Local time
Today, 14:43
Joined
Aug 15, 2011
Messages
76
I am testing portions of my app and found an unexpected problem. I have code in the change events among others. If I make all my selections using the mouse, all my events fire as expected. If I tab through and make my selection using the keyboard, then tab out to the next combo box, the events are not firing.

For example, if cboBox1 = 2, make txtBox1 visible, else leave it invisible. When I tab into cboBox 1 and make a keyboard selection of 2, the Change event code does not fire and make txtBox1 visible.

How do I correct this since most of my users will be using the tab key and keyboard since it is faster?
 
Since it's a Combo Box try using the After_Update event.
 
For example, if cboBox1 = 2, make txtBox1 visible, else leave it invisible. When I tab into cboBox 1 and make a keyboard selection of 2, the Change event code does not fire and make txtBox1 visible.
I remember you asking about events on a tab control and I recommended the Change event. In this thread you didn't specify if you're talking about the Change event of the Tab control or the Combo box. I think Gina has the impression you're talking about the change event of the Combo box.

So please clarify.
 
I remember you asking about events on a tab control and I recommended the Change event. In this thread you didn't specify if you're talking about the Change event of the Tab control or the Combo box. I think Gina has the impression you're talking about the change event of the Combo box.

So please clarify.

No problem. BTW, your info on the tab control fixed my problem. Thanks. Specifically, this post I was talking about the Change event for combo boxes on a form not the tab control itself. The findings from my testing will probably affect the objects in the tab control but not the tab control events themselves. Does this change the solution from Gina above? I was to disgusted at not finding this problem earlier that I turned the computer off last night. Haven't tested Gina's solution yet. Hope that clarifies the issue a little more.
 
I was just checking since your thread title had "Tab" in it ;)

No, Gina's suggestion will work, as always.
 
I see I arrived late to the party... It appears all is resolved so I'll move along!
 
Can you explain one thing to me. What is happening behind the scenes for my two scenarios? 1. I use the mouse to drop down a combo box and select my option. 2. I use the tab key to tab into the combo box use the keyboard to select my option. Why is one a Change and the other After_Update event?
 
I see I arrived late to the party... It appears all is resolved so I'll move along!
I will save you some wine next time
smile.gif


Why is one a Change and the other After_Update event?
In short, Change is for character-by-character change. After Update is change in the value of the control when it loses focus.
 
In short, Change is for character-by-character change. After Update is change in the value of the control when it loses focus.

Thanks for that answer. I don't do technical very well. The simple response as you stated it is perfect. Appreciate the help.
 

Users who are viewing this thread

Back
Top Bottom