Keypress - impossible? (that's impossible!)

Local time
Today, 11:45
Joined
Aug 2, 2004
Messages
272
I have a main data entry form--- it contains a bound text field to enter case numbers--

The Case Number will always start with a number '2', or a number '0'---

IF the user enters the first digit '2', then that digit will ALWAYS be followed by 8 zeros---

Typical Case numbers: 20000000123456 or 0371234567-01

Is it possble for a Keypress (or other event) to detect the entry of the first digit, and IF it is the number '2', automatically enter the next 8 zeros for the user???

I know this is a bit lazy, but we have hundreds of users who enter data all day long and may actually enter a case number many, many times each day. This would save a lot of key strokes..

Any help is appreciated.

Thanks!:)
 
Yes, entirely possible.

You might want to go with the OnChange event, though.

Something like this (air code):
Code:
Private Sub Field1_Change()
    If Me.Field1.Text = "2" Then
        Me.Field1.Text = "200000000"
        Me.Field1.SelStart = 9
    End If
End Sub
 
George! uda man!

simple---elegant--- best of all.... it works

thank you for your time--- much appreciated--

Sam :D
 

Users who are viewing this thread

Back
Top Bottom