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 / Forms / March 2008

Tip: Looking for answers? Try searching our database.

How can I require all-caps in a form field?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Theber - 31 Mar 2008 14:06 GMT
I want users to enter the data in one field of my form in all caps.  I can't
use a drop-down list, and don't think I can use an input mask as I don't know
anything about what the data will look like (how many characters, words,
punctuation, etc).  I didn't see a relevant option on the properties for the
text box.  Do I have to control it from the underlying table?  

Basically, I'd like it to default to caps so that the user doesn't have to
think about it.  Is this possible?  

Thanks!
Douglas J. Steele - 31 Mar 2008 14:09 GMT
In the AfterUpdate event of the control, use the UCase function to convert
the input to upper case:

Private Sub MyTextbox_AfterUpdate()

 Me.MyTextbox = UCase(Me.MyTextbox)

End Sub

Signature

Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

>I want users to enter the data in one field of my form in all caps.  I
>can't
[quoted text clipped - 9 lines]
>
> Thanks!
BruceM - 31 Mar 2008 14:23 GMT
You could just set the format of the text box to >.  That is, enter a
Greater Than sign in the text box Format property.  Let the users type using
whatever format they choose; it will display as all caps.
You would have to apply the same format whenever you want the data
displayed.
You could also convert the text using the UCase function.  In the text box
After Update event:
Me.YourField = UCase(Me.YourField)

>I want users to enter the data in one field of my form in all caps.  I
>can't
[quoted text clipped - 9 lines]
>
> Thanks!
Allen Browne - 31 Mar 2008 15:30 GMT
Bruce, I wonder if you realize that doesn't actually change the case?
It only affects the way Access displays it. Do a merge to Word (for
example), and you see the uncased data.

There are a couple of other side effects to doing this also:
- It truncates the display of memo fields.
- There were bugs in A2003 SP3 where you got nothing displayed in a combo if
the field had this format.

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> You could just set the format of the text box to >.  That is, enter a
> Greater Than sign in the text box Format property.  Let the users type
[quoted text clipped - 19 lines]
>>
>> Thanks!
Stockwell43 - 31 Mar 2008 16:01 GMT
Sorry Theber,

Place this code in the On KeyPress event of you textbox where you want the
caps.

Place this code under it just below the black line to separate it.
Private Sub ChangetoUpperCase(KeyAscii As Integer)
   If KeyAscii >= 97 And KeyAscii <= 122 Then
       KeyAscii = (KeyAscii - 32)
   End If
End Sub

I have in a working database and it will produce caps as you start typing
and will show on reports. See how it works out for you.

> Bruce, I wonder if you realize that doesn't actually change the case?
> It only affects the way Access displays it. Do a merge to Word (for
[quoted text clipped - 28 lines]
> >>
> >> Thanks!
Allen Browne - 31 Mar 2008 17:12 GMT
Does this handle the case where a user pastes something into the text box?

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Place this code in the On KeyPress event of you textbox where you want the
> caps.
[quoted text clipped - 8 lines]
> I have in a working database and it will produce caps as you start typing
> and will show on reports. See how it works out for you.
BruceM - 31 Mar 2008 16:06 GMT
Thanks for the observations, Allen.  If you are talking about the text box
format, I realize it changes only the way the text is displayed.  I have
seen indecipherable chemical formulas and other puzzlements as a result of
using all upper case, so I am reluctant to convert data.  However, since the
OP specifically mentioned forcing upper case I should probably have just
left out the formatting option.  I did not know about the combo box bugs,
nor about the truncated memo fields.

> Bruce, I wonder if you realize that doesn't actually change the case?
> It only affects the way Access displays it. Do a merge to Word (for
[quoted text clipped - 28 lines]
>>>
>>> Thanks!
Stockwell43 - 31 Mar 2008 14:53 GMT
Hi Theber,

If I understand you correctly, open your fields properties menu and place a
right arrow > , in the format line. When the user types it will show lower
case but when they exit the field it will show everything in caps.

> I want users to enter the data in one field of my form in all caps.  I can't
> use a drop-down list, and don't think I can use an input mask as I don't know
[quoted text clipped - 6 lines]
>
> Thanks!
 
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.