Using VB6
using Textbox in my form.
I want to limit the Input in the textbox, so maximum value should be 6.
User should enter up to six chars otherwise it should show error message
Button1.click
if Length(textbox1.text) > 6 then
enter only six chars
else if Length(textbox1.text) < 6 then
enter up to six chars
How do I make the code for the above condition.
Well, you’re getting close!
First … use the
Lenfunction, notLength, which doesn’t exist.Second … you can use the function
MsgBoxto display an error message.Putting it all together: