Upper Case

S

Sash

Is there a way to make all the fields on a form upper case or do I nee to
touch each one and use UCase?
 
A

Al Campagna

Sash
You could set the Format of any text control to...No matter how the data is stored in the table, the "display" of that
text value will be in upper case.
Simply "multi-select" all your text controls, and enter > in the format.

Be aware however that all caps is more difficult to read than proper
case, and is usually avoided.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
S

Sash

Al,
This is good to know, but I'm hoping to store the data as all caps. My
database is building a file to imported into a materials management system
that requires all caps.
 
F

fredg

Al,
This is good to know, but I'm hoping to store the data as all caps. My
database is building a file to imported into a materials management system
that requires all caps.

You can run an Update query to convert existing lower or mixed case
data into Upper case.

Update YourTable Set YourTable.[FieldName] = UCase([FieldName])

The above converts existing data.
To change data as it is entered into the form into Upper Case, code
that control's AfterUpdate event:
Me![ControlName] = UCase(Me![ControlName])

However the above AfterUpdate code will not effect data that is not
manually entered. If your data is imported, you'll have to import,
then immediately run the Update query.
 
L

Linq Adams via AccessMonster.com

I agree with all the things that have been said about using all caps, but I,
too, have run into situations where there were needed for just this reason.
Here a function that's turn Caps Lock on when a form is opened. It'll stay on
until Access is closed.

From the Objects Dialog box, go to Modules. Click on "New." Copy and paste
this in the new module.

'*********************************************
'Windows API/Global Declarations for :CapLock
'*********************************************
Public Const VK_CAPLOCK = &H14

Public Type KeyboardBytes
kbByte(0 To 255) As Byte
End Type
Public kbArray As KeyboardBytes

Public Declare Function GetKeyState Lib "user32" _
(ByVal nVirtKey As Long) As Long
Public Declare Function GetKeyboardState Lib "user32" _
(kbArray As KeyboardBytes) As Long
Public Declare Function SetKeyboardState Lib "user32" _
(kbArray As KeyboardBytes) As Long

Save the module and name it AllCaps.

Now, in the code module for the first form that is opened, or in all forms,
if necessary, palce this code:

Private Sub Form_Load()
GetKeyboardState kbArray
kbArray.kbByte(VK_CAPLOCK) = 1
SetKeyboardState kbArray
End Sub
 
C

Chris

In regards to Update Queries, is there a place to RUN this command?

Update YourTable Set YourTable.[FieldName] = UCase([FieldName])

or is there a procedure that may be followed in order to do so? I apologize
for posting to an older thread, but I couldn't find anything else that fit my
question.

Thank you.

Chris

fredg said:
Al,
This is good to know, but I'm hoping to store the data as all caps. My
database is building a file to imported into a materials management system
that requires all caps.

You can run an Update query to convert existing lower or mixed case
data into Upper case.

Update YourTable Set YourTable.[FieldName] = UCase([FieldName])

The above converts existing data.
To change data as it is entered into the form into Upper Case, code
that control's AfterUpdate event:
Me![ControlName] = UCase(Me![ControlName])

However the above AfterUpdate code will not effect data that is not
manually entered. If your data is imported, you'll have to import,
then immediately run the Update query.
 
J

John W. Vinson

In regards to Update Queries, is there a place to RUN this command?

Update YourTable Set YourTable.[FieldName] = UCase([FieldName])

You would create a new Query; open it in SQL view; and copy and paste this
into that window. Change YourTable to the name of your table, and FieldName to
the name of your field.

Alternatively, create a new query based on your table. Change it to an Update
query using the Query menu option, or the query type tool. A new row will
appear in the query design grid labeled "Update to". On that line, put

UCase([yourfieldnamehere])

underneath the field that you want to uppercase (using your actual fieldname
of course).
or is there a procedure that may be followed in order to do so? I apologize
for posting to an older thread, but I couldn't find anything else that fit my
question.

If you have a new question... just ask a new question. It's neither necessary
nor appropriate to tag your question onto somebody else's thread.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top