Access

  • Thread starter Thread starter Judy at school
  • Start date Start date
J

Judy at school

How do you make all entries in a database field automatically capitalize the
entry?
 
To capitalize text already in a table:
UPDATE mytable SET myfield=StrConv(myfield, 3)

To capitalize text as it is being entered in a textbox on a form, put this
code in the BeforeUpdate event of the textbox:
MyTextBox=StrConv(MyTextBox, 3)

Look up the StrConv function in Access Help for more information about
string conversion possibilities.
 
To capitalize text as it is being entered in a textbox on a form, put this
code in the BeforeUpdate event of the textbox:
MyTextBox=StrConv(MyTextBox, 3)

Afterupdate, actually - BeforeUpdate will trigger an inifinite loop since
changing the value will call BeforeUpdate again.
 
If you want characters to captalize as you type, put the following code
behind the KeyPress event behind your textbox:
-----------------------------------------------------------
Dim strCharacter As String

' Convert ANSI value to character string.
strCharacter = Chr(KeyAscii)
' Convert character to upper case, then to ANSI value.
KeyAscii = Asc(UCase(strCharacter))
 

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

Similar Threads

Field Formats 3
Word Tilde over X 7
Capitalize first letters in field 5
Access - automatically add email extensions 0
Input mask help 4
Data Fields 3
From large to small letters 4
Modify ALLCAPS memo field 7

Back
Top