By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,497 Members | 2,113 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,497 IT Pros & Developers. It's quick & easy.

ucase or an expression that makes lowercase letters turn to uppercase automatically

P: n/a


I need to make a field put uppercase letters in it when a lowercase
letter is entered into that field. Is there an expression to use or does
it have to be written in code?

*** Sent via Developersdex http://www.developersdex.com ***
Jan 9 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"Todd Snyder" <ts*****@cetusgroup.com> wrote in message
news:Cz**************@news.uswest.net...


I need to make a field put uppercase letters in it when a lowercase
letter is entered into that field. Is there an expression to use or does
it have to be written in code?


The simplest way to do this is in the design of the table, select the field
and into the format property write ">" (without the quotes, ie >).
This will not change the data as lower case letters will still be held in
the table, it just forces them to appear as upper case. If you have to make
sure that no lower case letters are entered into the table, then the only
way is to write code in the form where you enter the data. However, the
solution above is quick, simple and may do all you require.
Jan 9 '06 #2

P: n/a
what would the code be if my field name is site_id.

*** Sent via Developersdex http://www.developersdex.com ***
Jan 9 '06 #3

P: n/a
You could try this. I haven't tired it for years; its use should
[probably] belimited to those who feel comfortable with VBA and form's
coding]:

Private Declare Function GetKeyboardState Lib "user32" (pbKeyState As
Byte) As Long
Private Declare Function SetKeyboardState Lib "user32" (pbKeyState As
Byte) As Long
Private Const VK_CAPITAL = &H14
Dim mAKBState(0 To 255) As Byte

Private Sub txtLastName_GotFocus()
Dim aKBState(0 To 255) As Byte
GetKeyboardState mAKBState(0)
GetKeyboardState aKBState(0)
aKBState(VK_CAPITAL) = aKBState(VK_CAPITAL) Or 1
SetKeyboardState aKBState(0)
End Sub

Private Sub txtLastName_LostFocus()
SetKeyboardState mAKBState(0)
End Sub

Jan 9 '06 #4

P: n/a
If your text box is called something like txtBox1 then in the after
update event for the box use

Me.txtBox1 = UCase(Me.txtBox1)

Jan 10 '06 #5

P: n/a
Further to my previous reply I didn't read your second message so your
after update code would be

Me.[site_id]=UCase(Me.[site_id])

As a point of interest I find it easier to use

SiteID instead of site_id It saves messing about with square brackets
if you have no spaces in object names.

Jan 10 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.