Error Code assistance

Posted on 2006-07-14
Last Modified: 2010-04-30
VS6 SP5,

Have a form that employees fill out and then click submit button to email the contents of their
request to a manager, problem is if they forget to select who there manager is from combo2.text
it errors out and they loose everything else in the form they have already entered...I need error
control that will stop in the event of an error and allow the user time to select a manager
and continue with the submit button....Please help..

On Error GoTo err5
Select Case Combo2.Text
          Case Is = "user1", "user2", "user3", "user4"
          Case Else
          MsgBox "You are required to select a manager to send the request to!"
End Select

The Err.Clear above still alows the rest of my code to run...

More code that send email confirmation....
Question by:ittechie100
  • 3
LVL 11

Expert Comment

ID: 17111386
Have you tried putting an "exit sub" in the error handler??
LVL 11

Accepted Solution

leclairm earned 125 total points
ID: 17111417
Actually something more like :

Select Case Combo2.Text
          Case Is = "user1", "user2", "user3", "user4"
          Case Else
          MsgBox "You are required to select a manager to send the request to!"
          exit sub ' or exit function
End Select

Author Comment

ID: 17111449
Thank you..Sorry for something so small, however I've never taken any programming classes, learning as I go...

LVL 11

Expert Comment

ID: 17124957
Thanks for the points and good luck with your learning process.

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article ( for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

28 Experts available now in Live!

Get 1:1 Help Now