ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Making a text box active when returning to a screen (https://www.excelbanter.com/excel-programming/395476-making-text-box-active-when-returning-screen.html)

danhattan

Making a text box active when returning to a screen
 
I'm setting up a program that allows users to review their order, then return
to a previous screen if they need to make changes. Ideally, I'd like the user
to return to the screen with the first field (text box) active with all text
highlighted. I'm using the SetFocus property as such:
frmHeaderInfo.boxEndUser.SetFocus. The text box EnterFieldBehavior is set to
Select All. However, when the user is returned to the screen, the OK button
(last object clicked on that screen) has the focus.

I've combed through previous posts on this topic and appear to be using this
correctly, but clearly am not. If anyone can help me understand the flaw in
my approach, I'd appreciate it. Thanks in advance.


All times are GMT +1. The time now is 10:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com