?
Solved

Case Instructions

Posted on 2000-04-21
2
Medium Priority
?
142 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 60 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

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…
Suggested Courses
Course of the Month9 days, 7 hours left to enroll

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