473,626 Members | 3,031 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can MS Access change text to all CAPS as you type it?

269 Contributor
I want to use all caps in a database. I desire to show all caps AS YOU TYPE regardless of how the keyboard/caps lock is set. I tried to format my form field [CUST_LAST_NAME] with an on-click event…and this is the code I am trying to use (which I found on the internet while researching this).
Expand|Select|Wrap|Line Numbers
  1. Private Sub ChangetoUpperCase(KeyAscii As Integer)
  2. If KeyAscii >= 97 And KeyAscii <= 122 Then
  3. KeyAscii = (KeyAscii - 32)
  4. End If
  5. End Sub
I have tried to put this code in my code builder in many different ways…I’m not EXACTLY sure how to do it. Here is the text from my VBA screen:
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2.  
  3. Private Sub Command81_Click()
  4.  
  5. End Sub
  6.  
  7.  
  8. Private Sub CUST_LAST_NAME_KeyPress(KeyAscii As Integer)
  9. **I tried to put the code here, along with after the end sub, along with replacing the first private sub, etc etc etc.
  10. End Sub
  11. **There is more stuff below but access had it in there automatically so I’m assuming I can ignore it.**
How can I get this to work…or what’s another method to accomplish my goals?
I am aware of the UCASE function but I’d really like to see all caps as I type, not after event. This is my first experience with both Access and VBA, so take it easy on me if possible. Thanks in advance!
Oct 8 '09 #1
18 15636
JennDub
5 New Member
DanicaDear,
You could use an input mask such as ">aaaaa" in the text box "Input Mask" property. You would need to continue the a's above for as many characters as you would like to allow the user to enter.

~JennDub
Oct 8 '09 #2
DanicaDear
269 Contributor
The input mask requires that they enter info a certain way (ie. press the caps lock key). I don't want them to have to do that. I know it's just pressing a key...not that difficult....bu t I'm designing a program to match what they currently use and I want the entry to be the exact same. Currently, it doesn't matter how they type in the info, it appears and stores as caps. Thanks JennDub for your reply. Any more suggestions?
Oct 8 '09 #3
ajalwaysus
266 Recognized Expert Contributor
DanicaDear,

What JennDub suggests does work, the input mask upper cases all key strokes, there is no need to hit the Caps Lock key. Input mask is not a validation tool, it's a mask.

-AJ
Oct 8 '09 #4
JennDub
5 New Member
The input mask actually upgrades any text entered into all caps using the ">" symbol. It would eliminate the need for a user to click the "Caps Lock".
Oct 8 '09 #5
DanicaDear
269 Contributor
Would you recommend that I do this on the FORMS or at the TABLE?
Thanks guys!
Oct 8 '09 #6
DanicaDear
269 Contributor
Okay...I get it now. I have tried this...If I do it in FORMS the user sees the CAPS change as he types. If I do it in tables, it stores it as CAPS but the user might think he's entering in lower case, if he is. So I'll do it in FORMS since this sends it to the table in caps. I'm not crazy about that underline that it puts in the form...but I can quickly get over that. You guys are AWESOME. THANK YOU SO MUCH!!! I am VERY appreciative.
Oct 8 '09 #7
ajalwaysus
266 Recognized Expert Contributor
Nice quick resolution JennDub.

DanicaDear,
I agree that input masks are not the best thing, I honestly avoid it wherever I can. In regards to where to put it, I would recommend the table, and then any bound fields would inherit that input mask, and then you would also need to add the input mask to all unbound fields that relate to that field.

-AJ
Oct 8 '09 #8
NeoPa
32,567 Recognized Expert Moderator MVP
If the underline is a problem then you could use the event you attempted.
Expand|Select|Wrap|Line Numbers
  1. Private Sub CUST_LAST_NAME_KeyPress(KeyAscii As Integer)
  2.     Select Case KeyAscii
  3.     Case Asc("a") To Asc("z")
  4.         KeyAscii = KeyAscii + Asc("A") - Asc("a")
  5.     End Select
  6. End Sub
Oct 8 '09 #9
ajalwaysus
266 Recognized Expert Contributor
Now this is a nice piece of code, if I only I came across this in my college days, I may have been able to convince my professor to allow us to use this instead of the annoying input mask provided out of the box.

-AJ
Oct 8 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

14
5403
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB 7.2 environment, the choices the optimizer makes often seem flaky. But this last example really floored me. I was hoping someone could explain why I get worse response time when the optimizer uses two indexes, than when it uses one. Some context:
6
4738
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much appreciated. Thanks in advance
3
1308
by: vtpat | last post by:
I have a database for a small city grass roots organization. I have a list of block captains, there information is entered thru a form. Each of these block caps will bring in their contacts and we enter the list into table thru form. So far fine...I created a second form tied to same table for this, the next layer of contacts, (block caps contacts.) What I want to do is have the second form, when called, automatically append the block...
2
2187
by: Alicia | last post by:
If I wanted to create a table by hand create table temp( etc, where do I do it in access?
42
11515
by: lauren quantrell | last post by:
So many postings on not to use the treeview control, but nothing recently. Is it safe to swim there yet with Access 2000-Access 2003?
7
1226
by: Phillip Vong | last post by:
Newbie trying to learn. Using VS2005 and a simple aspx page. I have textbox1 and textbox2. Is there a simple client side code that will auto turn the text in textbox1 and textbox2 into ALL CAPS when you hit TAB from one to the other? Thanks!
2
9561
by: Gary | last post by:
Hello, I am trying to force the formatting of a Post Code field on my form, and require that all post codes are processed as FULL CAPS. I do not want to force the user to type on all caps, so would like it if onBlur, or onSubmit, that for example "im1 2ez" becomes "IM1 2EZ". Any help appreciated!! Gary.
7
2021
by: JDOMPer | last post by:
Don’t misunderstand me – I use AJAX, but I think there is a far simpler, elegant alternative that just uses Javascript, the DOM and Php ( hence - JDOMP) for data transfers, and is cross-browser without the need for work arounds. JDOMP works in recent versions of Explorer, Mozilla, Safari and Opera. Please note I will not deal with security issues which are always an issue whenever there is access to a database. You can simply change text on...
0
8196
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8701
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8637
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8364
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7192
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
2623
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1507
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.