View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default 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