UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> ALL Caps    
 
   
hansnyc
post Jun 13 2007, 11:01 AM
Post #1

UtterAccess Addict
Posts: 156



Hi
I aware now of the > sign in the format properties of a txt box on my report so it will print data on my form in all caps.
What I am looking for is for a code to put on my form that when I click save it converts my typed data into all caps onto the database.
is it possible?
Go to the top of the page
 
+
dashiellx2000
post Jun 13 2007, 11:06 AM
Post #2

UtterAccess VIP
Posts: 9,209
From: Maryland



On the afterupdate event of your controls put:

Me.ControlName = StrConv(me.ControlName, vbUpper)

HTH.
Go to the top of the page
 
+
hansnyc
post Jun 13 2007, 11:31 AM
Post #3

UtterAccess Addict
Posts: 156



yes but isn't a code to convert ALL controls to Upper Case?
thanks
Go to the top of the page
 
+
Nwulf
post Jun 13 2007, 11:38 AM
Post #4

UtterAccess Guru
Posts: 814
From: MN



hansnyc,

Another possiblity is: Me.ControlName = UCase(me.ControlName)

You could also look at the inputmask, but would rather use the strconv or ucase.

Nick
Go to the top of the page
 
+
dashiellx2000
post Jun 13 2007, 11:47 AM
Post #5

UtterAccess VIP
Posts: 9,209
From: Maryland



The only way to do that would be to loop through the controls and convert them:

CODE
Dim ctl as Control

For Each ctl in Me.Control
    If ctl.Type = acTextBox Then
        ctl.Value = StrConv(ctl.Value)
    End if
Next ctl


However, it would be much easier to convert them as they are entered.

HTH.
Go to the top of the page
 
+
doctor9
post Jun 13 2007, 12:22 PM
Post #6

UtterAccess VIP
Posts: 9,304
From: Wisconsin



Just a caveat:

Without knowing what sort of data you are dealing with, I'd just like to point out that you rarely want to STORE proper names as all caps. It is very difficult to reverse-engineer the proper case of people's first and last names, whereas it's very easy to store the data in proper case and merely DISPLAY it as all caps as needed.

Dennis
Go to the top of the page
 
+
dashiellx2000
post Jun 13 2007, 01:31 PM
Post #7

UtterAccess VIP
Posts: 9,209
From: Maryland



Very good point, Dennis.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 24th May 2013 - 04:20 PM