liquidspaces Posted November 22, 2002 Posted November 22, 2002 Here's what I need: On my form, I have a field that needs to be enabled while everything else is disabled. That's no problem, but it's with the next step that I have issues. Everything else will stay disabled until the first character is entered into this field. That character will be saved in the database, and at that time, everything else will become enabled. I'm having a terrible time checking this field's value to see if anything has been entered into it. This is necessary because I need the autonumber generation from my database to appear as soon as possible. Any help is appreciated. Kevin Quote
*Gurus* Derek Stone Posted November 22, 2002 *Gurus* Posted November 22, 2002 So what exactly do you need help with? Checking the database to see if a field has characters in it, or checking the TextBox to see if it has characters in it? Quote Posting Guidelines
liquidspaces Posted November 22, 2002 Author Posted November 22, 2002 Sorry for not being clear. I need to check the text box to see if there are characters in it. I BELIEVE I can get it to work with an if statement: if txtName.Text = " " Then everthing.enabled = false end if Everything starts out disabled just like it should. But there has to be in a loop, and I can't get the loop to work right. I tried it like this: if txtName.text = " " then while txtName.Text = " " everything.enabled = false end while else everything.enabled = true end if This doesn't even load. I've tried taking out the if's, but it crashes even harder. Quote
*Gurus* Derek Stone Posted November 22, 2002 *Gurus* Posted November 22, 2002 The TextBox class has a TextChanged event. Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged If TextBox1.Text.Length > 0 Then 'Enable controls End If End Sub Quote Posting Guidelines
liquidspaces Posted November 22, 2002 Author Posted November 22, 2002 Awesome! Everything is now working as planned. I hadn't even thought about a textbox event, I was trying to do it in the form load event. Thanks a lot, Kevin Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.