Question : How set a limit number of caracters for an independant TextBox in a Form

(I have ever ask this question but does'nt had a very good solution). I have a independant textbox that can receive 64000 char, but I want to set it for having only 50000 char max (by example). The best solution should have the same behaviour than when it have 64000 char. The textbox must don't save each time I press a key and must be OK when copy/paste too if it possible.
It is possible in Access 2003 and more to fix a limit to textbox under than 64000 char ?
Thanks ! (Sorry for my english)

Answer : How set a limit number of caracters for an independant TextBox in a Form

in the textboxes Change event, check to see the length of the text.  When I want to do this, I generally assign a label (lbl_CharRemaining) to the textbox and use code that looks something like:

Private Sub txt_TextBoxName_Change

    Static strPrevious as String

    if Len(me.txt_TextBoxName.text & "") > 50000 Then
        me.txt_TextBoxName.text = strPrevious
    Else
        strPrevious = me.txt_TextboxName.text
    End if
    me.lblCharRemaining = 50000 - Len(me.txt_TextBoxName.text & "")

End Sub

Random Solutions  
 
programming4us programming4us