Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 09-25-2020, 05:43 AM
eduzs eduzs is offline Userform control SETFOCUS being ignored Windows 10 Userform control SETFOCUS being ignored Office 2019
Expert
Userform control SETFOCUS being ignored
 
Join Date: May 2017
Posts: 260
eduzs is on a distinguished road
Default Userform control SETFOCUS being ignored


I'm trying everything and I can't do the SETFOCUS works it's totally ignored.
The only workaround I found is to play with tabindex, using beforeupdate to change the tabindex so correct control is focused after exiting a control.
Thanks.
Reply With Quote
  #2  
Old 09-25-2020, 06:21 AM
gmaxey gmaxey is offline Userform control SETFOCUS being ignored Windows 10 Userform control SETFOCUS being ignored Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,421
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

What event are you using to try to setfocus? If you are exiting a textbox and a frame at the same time then the textbox onExit is ignored. Use the frame on exit
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 09-25-2020, 06:57 AM
eduzs eduzs is offline Userform control SETFOCUS being ignored Windows 10 Userform control SETFOCUS being ignored Office 2019
Expert
Userform control SETFOCUS being ignored
 
Join Date: May 2017
Posts: 260
eduzs is on a distinguished road
Default

Hi!
I'm using Textbox before update (also tried with exit and afterupdate):
This works:

Code:
If FindInt = 1 Then
    With CB1
        .TabIndex = 3
        .SetFocus
        .DropDown
    End With
End If
But does not work if I remove ".TabIndex = 3" (workaround to force to go to CB1).
CB1 is a combobox.
All those controls are in page1 of a multipage (2 pages) word vba userform, everything else works fine.
Thanks
Reply With Quote
  #4  
Old 09-25-2020, 07:20 AM
gmaxey gmaxey is offline Userform control SETFOCUS being ignored Windows 10 Userform control SETFOCUS being ignored Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,421
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Can you post your document with form and code
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #5  
Old 09-25-2020, 11:12 AM
eduzs eduzs is offline Userform control SETFOCUS being ignored Windows 10 Userform control SETFOCUS being ignored Office 2019
Expert
Userform control SETFOCUS being ignored
 
Join Date: May 2017
Posts: 260
eduzs is on a distinguished road
Default

Hi! I can't.
But I was able to reproduce the problem with a new userform 4 text box and 1 combobox.
Textbox1 exit Combobox.setfocus does not works (this textbox1 and the combobox are not in sequence in tabindex).
Reply With Quote
  #6  
Old 09-25-2020, 12:12 PM
eduzs eduzs is offline Userform control SETFOCUS being ignored Windows 10 Userform control SETFOCUS being ignored Office 2019
Expert
Userform control SETFOCUS being ignored
 
Join Date: May 2017
Posts: 260
eduzs is on a distinguished road
Default

Googling about this problem, I saw similiar problem post elsewhere.
I will not take too much of your time, since I already have a workaround.
Thanks.

Last edited by eduzs; 09-26-2020 at 09:25 AM.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Userform control SETFOCUS being ignored Not changing a content control if re-entered and Userform pops up. ashbee Word VBA 3 01-26-2020 11:58 AM
Userform control SETFOCUS being ignored SetFocus command being ignored jrooney7 Word VBA 4 03-28-2019 07:13 AM
Userform control SETFOCUS being ignored Show Userform when Content Control CheckBox ticked derajlance Word VBA 1 05-13-2016 01:55 PM
Change parent for control from frame to userForm? Cosmo Word VBA 0 05-30-2014 02:19 PM
.setfocus not working why? Cbrehm Excel Programming 0 05-11-2011 02:52 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:27 AM.


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