A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Remove CAPS



 
 
Thread Tools Display Modes
  #1  
Old June 2nd, 2010, 01:44 PM posted to microsoft.public.access.forms
ladybug via AccessMonster.com
external usenet poster
 
Posts: 105
Default Remove CAPS

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

  #2  
Old June 2nd, 2010, 03:02 PM posted to microsoft.public.access.forms
Tom van Stiphout[_2_]
external usenet poster
 
Posts: 1,653
Default Remove CAPS

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!

  #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

  #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!

  #5  
Old June 3rd, 2010, 02:33 PM posted to microsoft.public.access.forms
Al Campagna[_2_]
external usenet poster
 
Posts: 1,462
Default Remove CAPS

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




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:16 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.