Jun 13 2007, 11:01 AM
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?
Jun 13 2007, 11:06 AM
On the afterupdate event of your controls put:
Me.ControlName = StrConv(me.ControlName, vbUpper)
Jun 13 2007, 11:31 AM
yes but isn't a code to convert ALL controls to Upper Case?
Jun 13 2007, 11:38 AM
Another possiblity is: Me.ControlName = UCase(me.ControlName)
You could also look at the inputmask, but would rather use the strconv or ucase.
Jun 13 2007, 11:47 AM
The only way to do that would be to loop through the controls and convert them:
Dim ctl as Control
For Each ctl in Me.Control
If ctl.Type = acTextBox Then
ctl.Value = StrConv(ctl.Value)
However, it would be much easier to convert them as they are entered.
Jun 13 2007, 12:22 PM
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.
Jun 13 2007, 01:31 PM
Very good point, Dennis.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here