Solved

Case Instructions

Posted on 2000-04-21
2
139 Views
Last Modified: 2010-05-02
Dear friend i wrote a code to make the following:

code to do one of the following actions, depending on the value of Choice:

i.When Choice is 3, 5, or 7, add 1 to a variable called Counter.

ii.When Choice is between 8 and 15 inclusive, set Counter to 0.

iii.When Choice is has any other value,display "invalid code" in a message box,

*****Code begin**********

Dim inChoice As Integer
Dim inCounter As Integer
inCounter = 0
inChoice = Val(Text1)
Select Case inChoice
    Case 3, 5, 7
        inCounter = inCounter + 1
    Case 8 To 15
        inCounter = 0
    Case 1, 2, 4, 6
        MsgBox "Invalid Code!", vbExclamation
        Exit Sub
    Case Is > 15
        MsgBox "Invalid Code!", vbExclamation
        Exit Sub
End Select

*********Code end*****
This code is right?? How can test this code???

Thanks,

Jairo Cardenas
Colombia
0
Comment
Question by:jcardenas
[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
2 Comments
 
LVL 28

Accepted Solution

by:
AzraSound earned 15 total points
ID: 2738839
to test it put a textbox and a command button on your form

paste the above code into the command button's click event

type a number into the textbox and click the button
0
 

Author Comment

by:jcardenas
ID: 2738855
My Friend, i have tested it according your instruction and it work fine.

Thanks and happy easter,

Jairo Cardenas
Colombia
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

735 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