Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / January 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Todd Snyder - 09 Jan 2006 16:54 GMT
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?
Anthony England - 09 Jan 2006 17:00 GMT
> 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.
Todd Snyder - 09 Jan 2006 17:08 GMT
what would the code be if my field name is site_id.
Geoff G - 10 Jan 2006 11:41 GMT
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.
Lyle Fairfield - 09 Jan 2006 17:59 GMT
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
Geoff G - 10 Jan 2006 11:37 GMT
If your text box is called something like txtBox1 then in the after
update event for the box use

Me.txtBox1 = UCase(Me.txtBox1)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.