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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force text to all caps

Status
Not open for further replies.

lgvelez

Technical User
Jun 6, 2000
108
US
One of our mainframe programs is going away. I have converted the ascii "dump" to an Access 97, complete with front end form for data entry. The ladies doing the data entry are used to their text being converted to all caps on the fly. I understand that Access 97 does not have an input mask for all text within a text field to be converted; however, I did find code in an MS KB article:

OnKeyPress property:
Sub Field0_KeyPress (KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub

Are there any other alternatives?

Thanks [sig]<p>Laura Velez<br><a href=mailto:lauravelez@home.com>lauravelez@home.com</a><br><a href= > </a><br> [/sig]
 
Hi,
You can set the &quot;Format&quot; property to &quot;>&quot; (without the string quotes) this will do the trick. To keep everthing in sync. set the property in both the field on the form and in the table. [sig]<p>Rob Marriott<br><a href=mailto:rob@career-connections.net>rob@career-connections.net</a><br>[/sig]
 
No help from me I think CCTC1's advice is the most effective way to do it. I thought you might like to read a quote from one of my (less user-friendly colleagues) JasonL : -

&quot;Why don't they just hold the shift-key or put the caps lock on?&quot; - needless to say JasonL gets more tech-support calls from Users than anyone I know!!!

Regards
Kirk
[sig][/sig]
 
Thanks Kirk. In a way I agree with JasonL, but I work very closely with the data entry people, and I am trying to create this new environment to be as close as possible to their old mainframe environment. Previously, in other scenarios, they have had their databases written for them by people who had no clue as to the processes being followed that the database had to emulate. [sig]<p>Laura Velez<br><a href=mailto:lauravelez@home.com>lauravelez@home.com</a><br><a href= > </a><br> [/sig]
 
Just one snag with JasonL's method:
The text does not appear to be Upper case until after you leave the cell (ie, automatically done by Access during the AfterUpdate event or something).

Also- The text is only being viewed that way, when format is specified like that.
The unfortunate thing about the Format property is, it does not store the data in the database the same way that it's displayed.
However, this feature DOES allow you to do some interesting things-
You can give people the feeling that they're using &quot;Smart&quot; numbers (fields that hold multiple pieces of information in them) without storing them. That way, if they're used to seeing a smart number on a form, the can continue to feel that way, and you can adjust the data in the backend.
For example:
Suppose the entry people are used to seeing a table's Record number, with the date
I'll use &quot;11222000-123&quot; as an example
where, 11222000 is 11/22/2000, and the record number is 123. This way, the date is included with the rest of the information in the field.
If you have a record date field, you can use this code
(assuming that Record ID Field is RecID and Record Date field is RecDate):

Private Sub Form1_OnCurrent()
Me.RecID.Format = IIf(Me.RecDate.Value <> &quot;&quot;, vbQuote & _
Format(Me.RecDate.Value, &quot;mdyyyy&quot;) & &quot;-&quot; & vbQuote & &quot;;@&quot;, &quot;&quot;)
End Sub


Not that that really has much to do with your post, but I figured you might have such &quot;Smart&quot; numbers with the legacy system you converted from.
Smart Numbers are for the most part frowned upon these days- they're not technically necessary anymore, and are really more of a hinderance than being usefull.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top