Results 1 to 3 of 3

Thread: Input boxes

  1. #1

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    46
    When using the input box function how do you know if the user hits ok or cancel. I have an input box in my program for users to enter a transaction number. If they enter a number and press ok everything goes well. If they do not enter a number and just press cancel then everything crashes, which is not good.

    Any help is appreicated.

  2. #2
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    736
    There may be a way to check for Cancel being chosen, much like the MsgBox, but the routine below works too.

    Code:
          Dim Message, Title
          Dim Default, MyValue
          Message = "Enter a Deskew value"
          Title = "Manual Deskew"   '
          Default = "5"
          MyValue = InputBox(Message, Title, Default)
          If MyValue = "" Then ' User selected Cancel
            Exit Sub
          Else
               ..... do whatever here 
          End If
    Of course you want to Dimension your variables correctly so they do not default to Variants.

  3. #3

    Thread Starter
    Member
    Join Date
    Sep 2000
    Posts
    46
    Thanks. It worked.

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