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: 29
Default UserForms, mandatory completion of fields

I have a series of userforms collecting user information. I now want to make
some of the fields on UserForm1 mandatory for completion so I am running the
following code:

Private Sub Userform_queryclose(Cancel As Integer, CloseMode As Integer)

If Len(TextBox1) = 0 Then
MsgBox "please complete all mandatory fields"
Cancel = True

End If

End Sub

However when a mandatory field is missed in userform1 and this code kicks
in, it still shows next Userform that would have been shown had all the
information been collected correctly. At the end of Userform1 I have the
following:

Unload UserForm1
Load UserForm5
UserForm5.Show

How do I stop this next userform from appearing until after all the
mandatory fields have been completed?

--
Zani
(if I have posted here, I really am stuck!)

 
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
mandatory fields dawie Excel Worksheet Functions 1 December 27th 06 06:49 PM
Excel Spreadsheet - Mandatory fields Mike in Philly Excel Worksheet Functions 1 April 7th 06 03:45 PM
UserForms - making responses mandatory Zani Excel Programming 5 March 9th 06 04:42 PM
Creating mandatory fields(cells)... SeattleKurt Excel Worksheet Functions 1 August 31st 05 09:53 PM
Can I make cell completion mandatory in excel? Peter Green Excel Discussion (Misc queries) 3 December 23rd 04 03:29 PM


All times are GMT +1. The time now is 02:20 PM.

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

About Us

"It's about Microsoft Excel"