Thread: Remove CAPS
View Single Post
  #3  
Old June 2nd, 2010, 08:23 PM posted to microsoft.public.access.forms
ladybug via AccessMonster.com
external usenet poster
 
Posts: 105
Default Remove CAPS

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