Hi
Again, the same problem, a still no solved.
Already I have the procedure however I will want to use to all TextBoxes
in my app using to this collection.
This code working fine but... for the array controlsCode:Option Explicit Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer) Text1(Index).MaxLength = 5 '<<< it specifies the amount of signs If KeyAscii = 13 Then '<<< exceptionally do it permit for Enter key SendKeys "{tab}" KeyAscii = 0 ElseIf KeyAscii <> 8 Then '<<< or for BackSpace key '<<< if is comma '<<< then block for next the comma and other non-numeric signs If InStr(1, Text1(Index), ",") And KeyAscii = 44 Then KeyAscii = 0 If Not IsNumeric(Chr$(KeyAscii)) And KeyAscii <> 44 Then MsgBox "ONLY numbers", vbCritical + vbOKOnly, "Attention !" KeyAscii = 0 End If End If '<<< however when first the sign it's comma then add sign an zero If Mid$(Text1(Index), 1, 1) = "," Then Text1(Index).Text = "0" & Text1(Index).Text Text1(Index).SelStart = Len(Text1(Index)) End If
Thanks in advance
BTW: how to protect before use of pasted value - I think there is no sense to prevent an pasting this. Rather necessary it will be a some the procedure to checking the values. How to make?




Reply With Quote