Solved

Case Instructions

Posted on 2000-04-21
2
127 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
2 Comments
 
LVL 28

Accepted Solution

by:
AzraSound earned 15 total points
Comment Utility
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
Comment Utility
My Friend, i have tested it according your instruction and it work fine.

Thanks and happy easter,

Jairo Cardenas
Colombia
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
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…

772 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

10 Experts available now in Live!

Get 1:1 Help Now