Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2005
    Posts
    113

    Unanswered: Limit characters in textboxes

    Hello,

    How can I limit the characters of a textbox to 1024?

    Thank you!

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    you could try putting some code behind the form that checks to see how many characters are entered
    it would need to be int he on change event
    the code woudl sort of be.....

    if len(mycontrolname)>1024 then
    beep
    msgbox limit exceeded
    endif
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I would catch this in pre-save validation.
    Inform the user that the value in the offending text box exceeds the limit and would they like to cancel and edit themselves, or truncate automatically (Left() function will do that for you).
    George
    Home | Blog

  4. #4
    Join Date
    Nov 2005
    Posts
    113
    You are great, both of you. Thanks Julita

  5. #5
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    I'd go healdem's way tbh. I would HATE it if after typing 5,000 characters that the stupid software only then tells me I have a limit of 1,000 characters. I would want to kill [s]gerogev[/s] the developer.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •