Results 1 to 6 of 6

Thread: Error RESOLVED

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2005
    Posts
    300

    Resolved Error RESOLVED

    I have a InputBox

    Code:
    StrVar = InputBox("Add A Base Word To The List", "Add Word To list")
    If i decide i don't wana add a word and click cancel it errors.

    How i stop this ??
    Last edited by Ricky1; Oct 29th, 2005 at 06:05 PM.
    Im Learning !!!!

  2. #2
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: Error

    It doesn't error because of that. What is the next line that it processes, or the line of the error?

  3. #3
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Error

    If you press Cancel the InputBox returns an empty string so you should check for that.

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2005
    Posts
    300

    Re: Error

    lstRoot.AddItem StrVar

    is next line.
    Im Learning !!!!

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2005
    Posts
    300

    Re: Error

    do i have to say something like
    Code:
    if Len(StrVar) = 0 Then Exit Sub
    ??
    Im Learning !!!!

  6. #6
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: Error

    I really can't see that you would get an error message, but it would add an empty string to the ListBox.
    VB Code:
    1. StrVar = InputBox("Add A Base Word To The List", "Add Word To list")
    2. If Len(StrVar) > 0 Then
    3.     lstRoot.AddItem StrVar
    4. End If

Posting Permissions

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



Click Here to Expand Forum to Full Width