ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Set Focus in "Form" environment (https://www.excelbanter.com/excel-programming/276092-re-set-focus-form-environment.html)

Tom Ogilvy

Set Focus in "Form" environment
 
Use the exit event and set cancel = true if there is a problem.

--
Regards,
Tom Ogilvy

"Gus Gazepis" wrote in message
...
I'm using a form that contains numerous text boxes to retrieve data for an
application. A particular text box in this form requires numerical data

to
be within a specific range. I need to detect out of range data and permit
correction.



I've written a "Private Sub" that runs "AfterUpdate". It produces a
"MsgBox" that identifies the condition, however, I can't figure out how

to
set the focus on this text box after acknowledging the "MsgBox" prompt.

The
"txtBox.SetFocus" command apparently does not work in the "AfterUpdate"
mode. Can anyone suggest code to accomplish this?



Thanks,

Gus Gazepis






All times are GMT +1. The time now is 06:46 PM.

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