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).
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:
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!
Code:
Private Sub ChangetoUpperCase(KeyAscii As Integer) If KeyAscii >= 97 And KeyAscii <= 122 Then KeyAscii = (KeyAscii - 32) End If End Sub
Code:
Option Compare Database Private Sub Command81_Click() End Sub Private Sub CUST_LAST_NAME_KeyPress(KeyAscii As Integer) **I tried to put the code here, along with after the end sub, along with replacing the first private sub, etc etc etc. End Sub **There is more stuff below but access had it in there automatically so I’m assuming I can ignore it.**
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!
Comment