+ Reply to Thread
Results 1 to 3 of 3

Bypass the run time error if user enters a wrong value

  1. #1
    Forum Contributor
    Join Date
    06-30-2006
    Posts
    116

    Bypass the run time error if user enters a wrong value

    Hello everyone,

    I have multiple pivot tables that contain information about distributors. The user can enter the distributor id in one cell and click a button that will set the distributor ID fields in the pivot tables to the ID entered by the user. Now when or if the user enters a wrong Distributor ID and click the button the run time error message pops up(for sure it wwill since it did not find the id in the pivot tables). I know I can create a list (data validation) where the user can select a specific ID but this is slowing my application a lot (trying to minimize the file size as much as possible cuz there are more than 10000 Ids). How can I fix this problem? In other word if the user enters a wrong Id I don't the error message to op up instead something else like a message to reenter a valid ID.

    Thank you

  2. #2
    Forum Contributor boylejob's Avatar
    Join Date
    02-22-2007
    Location
    Forest City, NC
    MS-Off Ver
    2003
    Posts
    562
    Richard,

    I am not exactly sure how you have this set up, but two things come to mind. You could use an error handler like the one below. The On Error GoTo can go pretty much anywhere within your subroutine and the Exit Sub stuff goes right before the End Sub statement (at least that is how I have it set up).

    Please Login or Register  to view this content.
    or

    I have to search on an ID and I handle it this way

    Please Login or Register  to view this content.
    Using the two examples above, you could code for your msgbox or whatever in the error handler or the else part of the if statement.

    Maybe this will give you some ideas
    Sincerely,
    Jeff

  3. #3
    Forum Contributor
    Join Date
    06-30-2006
    Posts
    116
    Jeff ..Thank you..This is what I was looking for. Much appreciated

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1