LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Exit Field vs Exit Button......

Just hit a weird one he I'm working with data validation on a form. The
first field on this for is a "must fill" and I check this with an event:

Private Sub txtName_Exit(ByVal Cancel As MSForms.ReturnBoolean)
if txtName.Value = "" then
error message stuff


When I hit the button to exit the screen, I expect to execute the following
code:

Private Sub ExitButton_Click()
Unload Me
MainMenu.Show
End Sub

But!!! If the cursor is positioned on the Name field, execution goes to the
txdtName_Exit routine before exiting!

I've been searching for an event to capture this and bypass the error
message, but have had no luck so far.

Suggestions?????

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do i make a button from a userform exit onto the document in . Pieface New Users to Excel 1 April 17th 07 07:35 PM
macro on exit of field Manuel Murieta Excel Programming 4 February 13th 07 06:38 PM
Disable Exit button on a UserForm Noemi Excel Discussion (Misc queries) 1 September 14th 06 09:37 PM
Userform Exit button Luis Excel Programming 2 December 30th 04 03:50 PM
If a called sub exit, how to the caller exit right away? luvgreen[_4_] Excel Programming 4 February 24th 04 05:06 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"