pasting into textbox

Spelthorne1

Registered User.
Local time
Today, 00:40
Joined
Feb 17, 2004
Messages
20
Im having a few problems with users pasting text into the textboxes and it locking the db.

I have a textbox 'Ref Val' that has

Private Sub Ref_Val_KeyPress(KeyAscii As Integer) 'Forces the ref val text into uppercase

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

so that the user doesnt have to worry about getting the case wrong. But when they paste the values from elsewhere into this txtbox, the db locks. Ive told them multiple times not to but hey, they still do it.
Ive realised that its the keypress code, but i would like to keep it. Therefore, does anyone know how to disable the pasting function for a particular text box. If not any suggestions?
 
You have the wrong event. Put it in the AfterUpdate.
 
Mile-O-Phile said:
You have the wrong event. Put it in the AfterUpdate.

Thanks mile,
 

Users who are viewing this thread

Back
Top Bottom