Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open a Form with All CAPS 2

Status
Not open for further replies.

lhall211

Technical User
Aug 7, 2000
8
US
Hope someone can help me out on this. I need a way to run a small procedure when an Access Database Form is first opened. It needs to convert every key stroke to Capital letters. I have a procedure (See below) that does this, but I have to put it in every KeyPress procedure that accepts AlphaNumeric characters (currently 17 separate procedures).<br><br>I would like to run this code and have it active for the entire time the user is in the form. I do not want to trip the Caps Lock Key because if the user minimizes Access to jump to another program, I don't want them cussing me because I left their keyboard in CAPS mode!<br><br>Anyway, here is what I currently am using:<br><br>'===============================================<br>Private Sub Name_KeyPress(KeyAscii As Integer)<br>Dim char As Variant<br><br>&nbsp;&nbsp;char = Chr(KeyAscii)<br>&nbsp;&nbsp;KeyAscii = Asc(UCase(char))<br><br>End Sub<br>'===============================================<br><br>I tried to come up with an AutoExec Macro but I'm getting nowhere. Again, hope someone can help.<br><br>Larry<br><A HREF="mailto:lhall211@mediaone.net">lhall211@mediaone.net</A><br>
 
Would putting a &gt; in the format of the properties of the textbox (your fields) be good enough for you???<br><br>Mary :eek:)
 
Telsa:<br><br>Thanks for the reminder about using &gt; Unfortunately, my users have gotten used to typing in CAPS, and the &gt; doesn't take affect until you leave the field. I'm afraid that everyone would just start putting on the CAPS key and after switching to another application start cussin' me.<br><br>Do you know if the Text Box/Format property can be accessed through code and maybe made to be in affect for &quot;Every&quot; object that is a Text Box?<br><br>Larry<br><br>
 
If you use the UCASE function it will capitalize every letter as they type but it is going to slow them down.<br><br>And which event you put it in may cause them more aggravation than its worth.<br><br>I would put the UCASE in the after Update event.<br><br>Private Sub FirstName_AfterUpdate()<br>&nbsp;&nbsp;&nbsp;&nbsp;Me!FirstName = UCase(Me!FirstName)<br>End Sub<br>when they leave the field it will capitalize all the letters they just keyed in.<br> <p>DougP<br><a href=mailto: dposton@universal1.com> dposton@universal1.com</a><br><a href= > </a><br> Ask me how Bar-codes can help you be more productive.
 
Doug:<br><br>Thanks for the VERY excellent tip. I had never considered using the Me! to work with a control. As for slowing things down, believe me, the folks in my department won't notice if the form slows by a few milliseconds. They would, however, notice that there are still in CAPS when they switch to another application and begin typing two and a-half sentences... look up and go...&quot;I liked it better when I didn't have to switch my CAPS lock off&quot;. They are so used to just starting to type and have the CAPS there, that any change will be working backwards.<br><br>If I could only find that one common place... in VB it's in Form_Load(), where I could drop some code that does what I'm now doing in practically every procedure.<br><br>Thanks for the Great Tip!<br><br>Larry<br>
 
Hello,
I was wondering if you ever got a solution for this issue. I am trying to do the same thing in some VB code. I would like to force Caps on when a user loads a form and keep caps on for the duration that the user is in the program. Leaving caps on after the user exits the program is not an issue. I know this post is pretty old, but figured maybe you are still out there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top