+ Reply to Thread
Results 1 to 3 of 3

limit character in textbox

  1. #1
    Steph
    Guest

    limit character in textbox

    Hello. I added a text box to a form I have. Is there a way to prevent the
    user from using the / or \ characters in that form? Thanks!



  2. #2
    ben
    Guest

    RE: limit character in textbox

    usually i just memorize the values then if it includes something i don't want
    i reinstate the old values after update eg.... (this code goes on form
    module)

    dim CurVal as string
    private sub Textbox1_Enter()
    curval = textbox1
    end sub

    private sub Textbox1_afterupdate()
    if instr(1,textbox1,"\") > 0 or _
    if instr(1,textbox1,"/") > 0 then _
    textbox1 = curval
    end sub

    ben



    --
    When you lose your mind, you free your life.


    "Steph" wrote:

    > Hello. I added a text box to a form I have. Is there a way to prevent the
    > user from using the / or \ characters in that form? Thanks!
    >
    >
    >


  3. #3
    ben
    Guest

    RE: limit character in textbox

    should say if you want to check it as each character is type I would use this
    instead

    dim CurVal as string

    Private sub Textbox1_enter()
    curval = textbox1
    end sub
    Private sub Textbox1_change()
    if instr(1,textbox1,"\") > 0 or _
    if instr(1,textbox1,"/") > then
    textbox1 = curval
    curval = textbox1
    end if
    end sub

    that other one only reads after a user enters data and leaves the box, this
    checks each character that is typed

    --
    When you lose your mind, you free your life.


    "Steph" wrote:

    > Hello. I added a text box to a form I have. Is there a way to prevent the
    > user from using the / or \ characters in that form? Thanks!
    >
    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1