I have a InputBox
If i decide i don't wana add a word and click cancel it errors.Code:StrVar = InputBox("Add A Base Word To The List", "Add Word To list")
How i stop this ??
Printable View
I have a InputBox
If i decide i don't wana add a word and click cancel it errors.Code:StrVar = InputBox("Add A Base Word To The List", "Add Word To list")
How i stop this ??
It doesn't error because of that. What is the next line that it processes, or the line of the error?
If you press Cancel the InputBox returns an empty string so you should check for that.
lstRoot.AddItem StrVar
is next line.
do i have to say something like
??Code:
if Len(StrVar) = 0 Then Exit Sub
I really can't see that you would get an error message, but it would add an empty string to the ListBox.VB Code:
StrVar = InputBox("Add A Base Word To The List", "Add Word To list") If Len(StrVar) > 0 Then lstRoot.AddItem StrVar End If