Remove CAPS

  • Follow


I have a text box in a form called Description.  I do not want users to be
able to enter in here with all CAPS.  They have been instructed, but there
are still a few that occasionaly forget.  I played around with the < and > in
Format, but the description can be fairly long and using these will cut off
some of the info.

Is there any other code that will remove the CAPS if entered that way?
However, I would prefer for it to keep the CAP in the beginning of a sentence.


Thank you!

-- 
Message posted via http://www.accessmonster.com

0
Reply ladybug 6/2/2010 12:44:37 PM

On Wed, 02 Jun 2010 12:44:37 GMT, "ladybug via AccessMonster.com"
<u21071@uwe> wrote:

One possibility would be in the control's AfterUpdate event:
Me.Description.Value = StrConv(Me.Description.Value, vbProperCase)
or perhaps:
Me.Description.Value = UCase$(Left$(Me.Description.Value ,1)) &
LCase$(Mid$(Me.Description.Value ,2)
Often these exercises become counter-productive since some sentences
naturally have some capitalization.

How about testing for all uppercase in the control's BeforeUpdate
event:
if ucase$(Me.Description.Value)=Me.Description.Value then
  msgbox "Yo! Not all uppercase!", vbCritical
  Cancel = true  'forces them to change it.
end if

-Tom.
Microsoft Access MVP


>I have a text box in a form called Description.  I do not want users to be
>able to enter in here with all CAPS.  They have been instructed, but there
>are still a few that occasionaly forget.  I played around with the < and > in
>Format, but the description can be fairly long and using these will cut off
>some of the info.
>
>Is there any other code that will remove the CAPS if entered that way?
>However, I would prefer for it to keep the CAP in the beginning of a sentence.
>
>
>Thank you!
0
Reply Tom 6/2/2010 2:02:31 PM

The first suggestion will not work because as you said it will remove the
uppercase in the text where it should actually exist (beginning of sentence).
The second could work, but I know the users will have an issue with having to
retype the whole thing over when they get that error at the very end.

I really need this to only update the text to lowercase in a report.  Is
there some code I can put in the Text Box Description in the report to just
remove all the CAPS, except for in the beginning of sentences?

Tom van Stiphout wrote:
>One possibility would be in the control's AfterUpdate event:
>Me.Description.Value = StrConv(Me.Description.Value, vbProperCase)
>or perhaps:
>Me.Description.Value = UCase$(Left$(Me.Description.Value ,1)) &
>LCase$(Mid$(Me.Description.Value ,2)
>Often these exercises become counter-productive since some sentences
>naturally have some capitalization.
>
>How about testing for all uppercase in the control's BeforeUpdate
>event:
>if ucase$(Me.Description.Value)=Me.Description.Value then
>  msgbox "Yo! Not all uppercase!", vbCritical
>  Cancel = true  'forces them to change it.
>end if
>
>-Tom.
>Microsoft Access MVP
>
>>I have a text box in a form called Description.  I do not want users to be
>>able to enter in here with all CAPS.  They have been instructed, but there
>[quoted text clipped - 6 lines]
>>
>>Thank you!

-- 
Message posted via http://www.accessmonster.com

0
Reply ladybug 6/2/2010 7:23:03 PM

On Wed, 02 Jun 2010 19:23:03 GMT, "ladybug via AccessMonster.com"
<u21071@uwe> wrote:

I already showed you that:
UCase$(Left$(Me.Description.Value ,1)) &
LCase$(Mid$(Me.Description.Value ,2)
If you look at it closely this capitalizes the first character and
converts the rest to lowercase.
Again, I wouldn't do this because some sentences naturally have upper
case letters in the non-first position.

-Tom.
Microsoft Access MVP


>The first suggestion will not work because as you said it will remove the
>uppercase in the text where it should actually exist (beginning of sentence).
>The second could work, but I know the users will have an issue with having to
>retype the whole thing over when they get that error at the very end.
>
>I really need this to only update the text to lowercase in a report.  Is
>there some code I can put in the Text Box Description in the report to just
>remove all the CAPS, except for in the beginning of sentences?
>
>Tom van Stiphout wrote:
>>One possibility would be in the control's AfterUpdate event:
>>Me.Description.Value = StrConv(Me.Description.Value, vbProperCase)
>>or perhaps:
>>Me.Description.Value = UCase$(Left$(Me.Description.Value ,1)) &
>>LCase$(Mid$(Me.Description.Value ,2)
>>Often these exercises become counter-productive since some sentences
>>naturally have some capitalization.
>>
>>How about testing for all uppercase in the control's BeforeUpdate
>>event:
>>if ucase$(Me.Description.Value)=Me.Description.Value then
>>  msgbox "Yo! Not all uppercase!", vbCritical
>>  Cancel = true  'forces them to change it.
>>end if
>>
>>-Tom.
>>Microsoft Access MVP
>>
>>>I have a text box in a form called Description.  I do not want users to be
>>>able to enter in here with all CAPS.  They have been instructed, but there
>>[quoted text clipped - 6 lines]
>>>
>>>Thank you!
0
Reply Tom 6/3/2010 4:04:01 AM

ladybug,
    I don't think you'll find a perfect solution to this problem.
    Proper, and Ucase provide some functionality, but they can not
properly handle all real world Caps/Lowercase requirements...
particularly in "sentence" type text.
    I am unaware of any application that can properly convert
random, all caps sentences/words to correct Upper/Lower case text.

    In this case, I think your best bet is to make some warning text visible
when users enter the field.  Something like a label ("Do not use all caps!")
made visible, and flashing for just a second or two... on the field's
OnEnter event.  A message box is a bit intrusive, but just some
flashing text for a moment, should be sufficient.
    If not, then you have a "user" problem... not a design" problem.

    I think this is a case of... "It's better to prevent a problem from
happening, than to try to code around it."
    You have responsibilities as a developer, but the users have
responsibilities too.
-- 
    hth
    Al Campagna
    Microsoft Access MVP 2007-2009
    http://home.comcast.net/~cccsolutions/index.html

    "Find a job that you love... and you'll never work a day in your life."

"ladybug via AccessMonster.com" <u21071@uwe> wrote in message
news:a8f033aeab2c4@uwe...
> The first suggestion will not work because as you said it will remove the
> uppercase in the text where it should actually exist (beginning of
> sentence).
> The second could work, but I know the users will have an issue with having
> to
> retype the whole thing over when they get that error at the very end.
>
> I really need this to only update the text to lowercase in a report.  Is
> there some code I can put in the Text Box Description in the report to
> just
> remove all the CAPS, except for in the beginning of sentences?
>
> Tom van Stiphout wrote:
>>One possibility would be in the control's AfterUpdate event:
>>Me.Description.Value = StrConv(Me.Description.Value, vbProperCase)
>>or perhaps:
>>Me.Description.Value = UCase$(Left$(Me.Description.Value ,1)) &
>>LCase$(Mid$(Me.Description.Value ,2)
>>Often these exercises become counter-productive since some sentences
>>naturally have some capitalization.
>>
>>How about testing for all uppercase in the control's BeforeUpdate
>>event:
>>if ucase$(Me.Description.Value)=Me.Description.Value then
>>  msgbox "Yo! Not all uppercase!", vbCritical
>>  Cancel = true  'forces them to change it.
>>end if
>>
>>-Tom.
>>Microsoft Access MVP
>>
>>>I have a text box in a form called Description.  I do not want users to
>>>be
>>>able to enter in here with all CAPS.  They have been instructed, but
>>>there
>>[quoted text clipped - 6 lines]
>>>
>>>Thank you!
>
> -- 
> Message posted via http://www.accessmonster.com
>



0
Reply Al 6/3/2010 1:33:21 PM

4 Replies
606 Views

(page loaded in 0.068 seconds)


Reply: