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 » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Access



 
 
Thread Tools Display Modes
  #1  
Old March 29th, 2008, 01:13 PM posted to microsoft.public.access.tablesdbdesign
Judy at school
external usenet poster
 
Posts: 1
Default Access

How do you make all entries in a database field automatically capitalize the
entry?

--
Thank you.
  #2  
Old March 29th, 2008, 02:15 PM posted to microsoft.public.access.tablesdbdesign
TedMi
external usenet poster
 
Posts: 507
Default Access

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.
--
TedMi

  #3  
Old March 29th, 2008, 06:33 PM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Access

On Sat, 29 Mar 2008 07:15:00 -0700, tedmi
wrote:

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.
--

John W. Vinson [MVP]
  #4  
Old April 1st, 2008, 07:21 PM posted to microsoft.public.access.tablesdbdesign
Evan Keel
external usenet poster
 
Posts: 46
Default Access

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))
-------------------------------------------------------------
Evan
P.S I copied this code from the VB Help system

"Judy at school" wrote in message
...
How do you make all entries in a database field automatically capitalize

the
entry?

--
Thank you.



 




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 03:47 PM.


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