Preventing ALL CAPS

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I prevent users from typing data into forms using ALL CAPS? The data
is company names so once in a while there will be a company with all caps but
for the most part this field should not have data inputted in all caps.

What is the easiest and simplest way to prevent this from happening?
 
Tell them to stop!

Since you say that sometimes they will be all caps, there is not much you
can do from a programming standpoint. Sounds more like a management issue.
I know if one of my employees was typing in all caps and messing up my
reports, I'd tell them to stop, not look for a way to program around it.
 
You could use the AfterUpdate event of the text box to warn the user if they
entered in all caps, e.g.:

If StrComp(Me.Company, UCase(Me.Company), vbBinaryCompare) <> 0 Then
 
The name of the field is "Target" and it's a text box. The underlying table
is called "MainTable". What is the exact code I should use. Thanks!
 
In the AfterUpdate event procedure of the Target text box, replace "Company"
with "Target".
 
Sounds familiar!

Private Sub Target_AfterUpdate()
If StrComp(Me.Company, UCase(Me.Company), vbBinaryCompare) <> 0 Then
MsgBox "You enter in all caps, we break your knee caps!"
End If
End Sub

:-)
 
Back
Top