You make a good point with regard to the queries. This client is a law
enforcement agency. There data is transferred to various goverment agencies.
There may be a data standard that they are trying to maintain for other
systems. I was not directly involved with the client so I'm not sure what
the reason is. It may be as simple as the fact that the officers can't type
and they don't want to have to use the shift key :). What ever the reason
is, I have been instructed to find a way to do it. :(.
Could you clarify the following?
> The OnKey event is probably your best bet. You could use VBA to loop
> through the AllForms collection and define the event in each one,
> using a one-line call to a single module.
I have created a subroutine that will add the following to each form module
and then set the form's KeyPreview to True. Is that what you are suggesting?
Private Sub Form_KeyPress(KeyAscii As Integer)
Dim strCharacter As String
' Convert ANSI value to character string.
strCharacter = Chr(KeyAscii)
' Convert character to upper case, then to ANSI value.
KeyAscii = Asc(UCase(strCharacter))
End Sub
This would be added to all 625 forms. Is there a way to trigger a forms
OnKey event from a single module eliminating the need to add this to each
form?
Your help is greatly appreciated.
Dan
> >They actually want the data to be stored in
> >uppercase to be consistant with their older legacy data.
[quoted text clipped - 8 lines]
>
> John W. Vinson[MVP]
Brendan Reynolds - 31 Mar 2005 21:42 GMT
A potential problem with this, Dan, is that it can be by-passed by copy and
paste - if a user pastes data into a text box instead of typing it, the
KeyPress event will not be fired. Using the BeforeUpdate event would be
safer, but unfortunately would involve more work.

Signature
Brendan Reynolds (MVP)
> You make a good point with regard to the queries. This client is a law
> enforcement agency. There data is transferred to various goverment
[quoted text clipped - 45 lines]
>>
>> John W. Vinson[MVP]
DanJ - 31 Mar 2005 22:57 GMT
Thanks for the 'heads up'. I realize that there is that potential and I will
need to make them aware of that if I use the 'KeyPress' event. However,
since there are thousands of text controls in this application, it would
probably be worth the risk when weighed against the time and maintenance
involve with adding code to each control's 'BeforeUpdate' event (or even if
it was done through some validation code in the forms BeforeUpdate event).
I appreciate the input though. This is something that I need to document in
case this happens in the field.
Dan
> A potential problem with this, Dan, is that it can be by-passed by copy and
> paste - if a user pastes data into a text box instead of typing it, the
[quoted text clipped - 50 lines]
> >>
> >> John W. Vinson[MVP]