Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Error Code assistance

Posted on 2006-07-14
4
Medium Priority
?
170 Views
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
err5:
Err.Clear

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

More code that send email confirmation....
0
Comment
Question by:ittechie100
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 11

Expert Comment

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

Accepted Solution

by:
leclairm earned 500 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
0
 

Author Comment

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

Thanks...
0
 
LVL 11

Expert Comment

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…
Suggested Courses

705 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