View Single Post
 
Old 06-27-2015, 07:40 AM
NobodysPerfect NobodysPerfect is offline Windows 8 Office 2010 32bit
Competent Performer
 
Join Date: Jan 2014
Location: Germany
Posts: 136
NobodysPerfect is on a distinguished road
Default Set Focus on ActiveX Text Box after Validation

Hi to all.

I have to validate an ActiveX text box (no problem), but as the text box is obligatory the focus shall be (re)set to the text box if empty (problem).

Using the '_LostFocus' event in Excel the single line …
Code:
If Me.TextBox1.Value = "" Then Me.TextBox1.Activate
… does the job.

In Word the code is executed, but the focus doesn't change all. Whatever object will be selected to 'lose focus' it remains selected.

Any idea which code line(s) might (re)set the focus.

Thanks for your help
NP
Reply With Quote