Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default test for field that just has spaces in it

Thanks for taking the time to read my question.

I have a form on which users enter info. The only required field is the
product code. I have it that if there is no value in the product code field,
they can't click the button to add the new info. Even if they add all data,
then delete the product code, the button becomes inactive. The only way they
can get around this.. and they have :( is to add a bunch of spaces.

How do I test for an indefinate amount of spaces?

Thanks,

Brad
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default test for field that just has spaces in it

Use the Trim function, something like this:

If Trim(Text1) = "" Then
MsgBox "Input Required"
Text1.SetFocus
Exit Sub
End If


"Brad" wrote:

Thanks for taking the time to read my question.

I have a form on which users enter info. The only required field is the
product code. I have it that if there is no value in the product code field,
they can't click the button to add the new info. Even if they add all data,
then delete the product code, the button becomes inactive. The only way they
can get around this.. and they have :( is to add a bunch of spaces.

How do I test for an indefinate amount of spaces?

Thanks,

Brad

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 846
Default test for field that just has spaces in it

Thanks Charlie!

That is perfect!

Brad

"Charlie" wrote:

Use the Trim function, something like this:

If Trim(Text1) = "" Then
MsgBox "Input Required"
Text1.SetFocus
Exit Sub
End If


"Brad" wrote:

Thanks for taking the time to read my question.

I have a form on which users enter info. The only required field is the
product code. I have it that if there is no value in the product code field,
they can't click the button to add the new info. Even if they add all data,
then delete the product code, the button becomes inactive. The only way they
can get around this.. and they have :( is to add a bunch of spaces.

How do I test for an indefinate amount of spaces?

Thanks,

Brad

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
Replace spaces at the end of a field Colin3440 Excel Discussion (Misc queries) 1 March 3rd 10 01:24 PM
How do I put spaces in a field Stan in South Africa Excel Discussion (Misc queries) 2 July 8th 08 09:12 AM
How do you remove excess spaces from an Excel field? sarah_jane Excel Discussion (Misc queries) 1 June 1st 05 08:15 AM
Add spaces to end of field in save as PRN Jim[_37_] Excel Programming 2 January 9th 04 08:19 PM
Adding spaces to a text field Jason Trolian Excel Programming 2 December 1st 03 04:26 PM


All times are GMT +1. The time now is 10:42 AM.

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"