Set a limit characters to a field using Visual Studio 2012 with Access 2007

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hey, its I want to set a txtbox text limit to 256
i know the code
<div style="color:Black;background-color:White; <pre>
<p style=<span style="color:#A31515; "color:#333333; font-family:inherit; font-size:13.600000381469727px; line-height:16.799999237060547px"> <span style="color:Blue; Private <span style="color:Blue; Sub TextBox1_TextChanged(<span style="color:Blue; ByVal sender <span style="color:Blue; As System.Object, <span style="color:Blue; ByVal e <span style="color:Blue; As System.EventArgs) <span style="color:Blue; Handles TextBox1.TextChanged
<span style="color:Blue; If StringLength(TextBox1.Text) > TextBox1.Width - 256 <span style="color:Blue; Then
TextBox1.Text = TextBox1.Text.Remove(TextBox1.Text.Length - 1, 1)
<span style="color:Blue; End <span style="color:Blue; If
TextBox1.SelectionStart = TextBox1.Text.Length
TextBox1.SelectionLength = 0
<span style="color:Blue; End <span style="color:Blue; Sub <p style=<span style="color:#A31515; "color:#333333; font-family:inherit; font-size:13.600000381469727px; line-height:16.799999237060547px"> <span style=<span style="color:#A31515; "color:#333333; font-size:medium"><span style=<span style="color:#A31515; "line-height:16.799999237060547px">does that code works? will it affect <span style="color:Blue; my database? <span style="color:Blue; like corrupt it.. since i am <span style=<span style="color:#A31515; "color:#333333; font-size:medium"><span style=<span style="color:#A31515; "line-height:16.799999237060547px">afraid<span style=<span style="color:#A31515; "color:#333333; font-size:medium"><span style=<span style="color:#A31515; "line-height:16.799999237060547px">of being corrupted it again -_-
[/code]
<hr class="sig Rich

View the full article
 
Back
Top