Thread: Remove CAPS
View Single Post
  #4  
Old June 3rd, 2010, 05:04 AM posted to microsoft.public.access.forms
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default Remove CAPS

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!