Hi!
My users send SMS via a form.
If they insert an crlf it counts 2 ditigts in an SMS and i would like to avoid that they insert Chr(10).
Private Sub Mailtext_KeyPress(keyascii As Integer)
If keyascii = Asc(Chr(10)) Then
MsgBox "No returns in a SMS
Me.Mailtext.Text = Replace(Me.Mailtext.Text, Chr(10), Chr(32))
End If
Above code makes a strange behavoir:
Within the textbox the text starts then in the second line and it seems, like an aoutomatic return has been set BEFORE my text.
Any idea, how I can solve my probelm, either to avoid returns at all or delete the Chr(10) after inserted.
FYI: Me.Mailtext.Text = Mid(Me.Mailtext.Text,1,Len(Me.Mailtext.text)-1)
or
Me.Mailtext.Text = Left(Me.Mailtext.Text,Len(Me.Mailtext.text)-1)
makes the same. My text moves allways in the second line of the textbox and has (most likely) a return before the text.
Thanks
Michael
My users send SMS via a form.
If they insert an crlf it counts 2 ditigts in an SMS and i would like to avoid that they insert Chr(10).
Private Sub Mailtext_KeyPress(keyascii As Integer)
If keyascii = Asc(Chr(10)) Then
MsgBox "No returns in a SMS
Me.Mailtext.Text = Replace(Me.Mailtext.Text, Chr(10), Chr(32))
End If
Above code makes a strange behavoir:
Within the textbox the text starts then in the second line and it seems, like an aoutomatic return has been set BEFORE my text.
Any idea, how I can solve my probelm, either to avoid returns at all or delete the Chr(10) after inserted.
FYI: Me.Mailtext.Text = Mid(Me.Mailtext.Text,1,Len(Me.Mailtext.text)-1)
or
Me.Mailtext.Text = Left(Me.Mailtext.Text,Len(Me.Mailtext.text)-1)
makes the same. My text moves allways in the second line of the textbox and has (most likely) a return before the text.
Thanks
Michael