texbox needs help

I wanna validate a textbox in such a way that whenever i put in some information in the textbox it shud not include any other than "main Frames", "Mini Computers", "Desktops","Servers"
If a choice other than these is put, it shud give a message for wrong choice opted...its urgent...pls help

Comments

  • : I wanna validate a textbox in such a way that whenever i put in some information in the textbox it shud not include any other than "main Frames", "Mini Computers", "Desktops","Servers"
    : If a choice other than these is put, it shud give a message for wrong choice opted...its urgent...pls help
    :
    You should probably use a ComboBox instead of a textbox
  • : : I wanna validate a textbox in such a way that whenever i put in some information in the textbox it shud not include any other than "main Frames", "Mini Computers", "Desktops","Servers"
    : : If a choice other than these is put, it shud give a message for wrong choice opted...its urgent...pls help
    : :
    : You should probably use a ComboBox instead of a textbox
    :


    Your idea of using a combobox isnt bad enough, but my requirements for the time being is to use a text box and hence i wanna know how to validate the texbox that pikcs only the values i specify ...


  • : I wanna validate a textbox in such a way that whenever i put in some information in the textbox it shud not include any other than "main Frames", "Mini Computers", "Desktops","Servers"
    : If a choice other than these is put, it shud give a message for wrong choice opted...its urgent...pls help
    :

    Very easy.
    Why not put in a Combo Box then use this:

    Private Sub Form_Load()
    Combo1.AddItem ("Main Frames")
    Combo1.AddItem ("Mini Computers")
    Combo1.AddItem ("Desktops")
    End Sub
    . . . . . . . . . .
    and on and on.
    But if you want:
    Paste a text box on the form.
    goto code
    type in:

    Private Sub Text1_Click()

    If text1.text = "Main Frames" then
    ' Whatever you want
    Else
    msgbox("Error")
    exit sub
    end if

    end sub


    Then when someone clicks the box it gives them an error.
    If you:
    Private Sub Text1_CHANGE()
    then this might be better.
    Not sure if you want up to date checking or
    If checking(like clicking an OK button)

    Send me a e-mail at Brettsbignose@hotmail.com
    if your following me.
    Let me know if it helped you or I just didnt get it?

    Brett Clark
    The Seventh Grader

  • : : I wanna validate a textbox in such a way that whenever i put in some information in the textbox it shud not include any other than "main Frames", "Mini Computers", "Desktops","Servers"
    : : If a choice other than these is put, it shud give a message for wrong choice opted...its urgent...pls help
    : :
    :
    : Very easy.
    : Why not put in a Combo Box then use this:
    :
    : Private Sub Form_Load()
    : Combo1.AddItem ("Main Frames")
    : Combo1.AddItem ("Mini Computers")
    : Combo1.AddItem ("Desktops")
    : End Sub
    : . . . . . . . . . .
    : and on and on.
    : But if you want:
    : Paste a text box on the form.
    : goto code
    : type in:
    :
    : Private Sub Text1_Click()
    :
    : If text1.text = "Main Frames" then
    : ' Whatever you want
    : Else
    : msgbox("Error")
    : exit sub
    : end if
    :
    : end sub
    :
    :
    : Then when someone clicks the box it gives them an error.
    : If you:
    : Private Sub Text1_CHANGE()
    : then this might be better.
    : Not sure if you want up to date checking or
    : If checking(like clicking an OK button)
    :
    : Send me a e-mail at Brettsbignose@hotmail.com
    : if your following me.
    : Let me know if it helped you or I just didnt get it?
    :
    : Brett Clark
    : The Seventh Grader
    :
    :
    It was hell lot of a help buddy!!
    Thanx a lot...


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories