Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Users leaving blanks

I have a user input form and I am trying to stop users
leaving the fields empty. I am using the following code -

If txtname.Value Is Null Then MsgBox "Please ensure all
the boxes are filled before clicking OK" End Sub

Where am I going wrong?

Yvonne
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 244
Default Users leaving blanks

Im assuming this is for the click event of the OK butto
try something like this

Private Sub btnOk_Click(
Dim txtbx As MSForms.TextBo
For Each ctrl In Me.Control
If TypeOf ctrl Is MSForms.TextBox The
Set txtbx = ctr
If txtbx.value = "" then
msgbox "Please ensure all the boxes are filled before clicking OK
txtbx.setfocu
Exit Su
End i
End I
Nex
'put your proceed if everything is ok code her

End Su


----- Yvonne Wilder wrote: ----

I have a user input form and I am trying to stop users
leaving the fields empty. I am using the following code

If txtname.Value Is Null Then MsgBox "Please ensure all
the boxes are filled before clicking OK" End Su

Where am I going wrong

Yvonn

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
replacing zeros with blanks but leaving dates alone Evil with a K[_2_] Excel Worksheet Functions 3 May 15th 09 06:48 PM
How to hide blank rows after data whilst leaving some blanks. thomsonpa New Users to Excel 0 January 10th 08 06:05 PM
Copy a column leaving out any blanks Mike Pearson[_2_] Excel Worksheet Functions 5 June 10th 07 02:09 PM
copy range of cells with blanks then paste without blanks justaguyfromky Excel Worksheet Functions 1 September 3rd 06 07:56 PM
Paste Special Skip Blanks not skipping blanks, but overwriting... gsrosin Excel Discussion (Misc queries) 0 February 22nd 05 03:33 AM


All times are GMT +1. The time now is 12:00 AM.

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"