BrenoAguiar
IS-IT--Management
I have this code to limit the number of characteres in the text box:
Private Sub LimitChange(ctl As Control, iMaxLen As Integer)
On Error GoTo Err_LimitChange
If Len(ctl.Text) > iMaxLen Then
MsgBox "Limited to " & iMaxLen & " characters.", vbExclamation, "Too long"
ctl.Text = Left(ctl.Text, iMaxLen)
ctl.SelStart = iMaxLen
End If
Exit_LimitChange:
Exit Sub
End Sub
WHERE "imaxlen" is here:
Private Sub addnt_KeyPress(KeyAscii As Integer)
Call LimitKeyPress(Me.addnt, 460, KeyAscii)
End Sub
The error I'm getting highlights the "Left(ctl.Text, iMaxLen) when you click the "Debug" button.
when I run this on My machine works just great. But If I run this on My server, this error 3075 pops up. Also won't recognize the chr(13) or chr(24).
Any thoughts?
Private Sub LimitChange(ctl As Control, iMaxLen As Integer)
On Error GoTo Err_LimitChange
If Len(ctl.Text) > iMaxLen Then
MsgBox "Limited to " & iMaxLen & " characters.", vbExclamation, "Too long"
ctl.Text = Left(ctl.Text, iMaxLen)
ctl.SelStart = iMaxLen
End If
Exit_LimitChange:
Exit Sub
End Sub
WHERE "imaxlen" is here:
Private Sub addnt_KeyPress(KeyAscii As Integer)
Call LimitKeyPress(Me.addnt, 460, KeyAscii)
End Sub
The error I'm getting highlights the "Left(ctl.Text, iMaxLen) when you click the "Debug" button.
when I run this on My machine works just great. But If I run this on My server, this error 3075 pops up. Also won't recognize the chr(13) or chr(24).
Any thoughts?