Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Pop-up Error Messages

Does anyone know how to generate a pop-up message when exiting a form
if 'txtFieldA' is left blank (""), that reads:

"Please fill in txtFieldA."

Thank

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Pop-up Error Messages

Best to have a button for exiting so that you can control it. The code
behind the button would be something like

Private Sub cmdExit_Click()

If txtFieldA.Text = "" Then
MsgBox "Must input this field"
With txtFieldA
.SelStart = 1
.SetFocus
End With
Else
Me.Hide
End If

End Sub

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"rbaxter " wrote in message
...
Does anyone know how to generate a pop-up message when exiting a form,
if 'txtFieldA' is left blank (""), that reads:

"Please fill in txtFieldA."

Thanks


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Pop-up Error Messages

thank

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Pop-up Error Messages

You could use the Userform_QueryClose event, which is
fired when the form is closed.
Reply
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
Error Messages msao Excel Worksheet Functions 4 November 17th 09 04:55 PM
#N/A error messages Loren Newton New Users to Excel 2 August 15th 08 04:45 PM
Error Messages Kathy Excel Discussion (Misc queries) 9 May 16th 06 03:01 PM
Error Messages Jo Davis Excel Worksheet Functions 1 January 13th 06 12:04 PM
Error Messages mikel2634 Excel Worksheet Functions 0 May 21st 05 04:30 PM


All times are GMT +1. The time now is 02:08 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"