Solved

Error Code assistance

Posted on 2006-07-14
4
162 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
  • 3
4 Comments
 
LVL 11

Expert Comment

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

Accepted Solution

by:
leclairm earned 125 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks for the points and good luck with your learning process.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

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…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

762 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

7 Experts available now in Live!

Get 1:1 Help Now