Please help me to rectify the mistake

Hellooo,
I have created a colour code resistor calculator. The program consists of 4 combobox, 2 Textbox and 1 button. I have input the coding for the calculate button to count the resistance, but the Textbox which shows the resistance only displays 0 as the answer.
Another thing would be the tolerance which i have also input the coding in the second textbox doesn't show any value. I do not know if it is my coding problem or my pc problem.
I'm using Visual Basic Express 2010. 
Can anyone solve this problem ASAP since i am in a rush of completing a project.
Thank you!
Below is my coding:
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub btn_calculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_calculate.Click
Dim band1 As Integer
Dim band2 As Integer
Dim band3 As Integer
Dim band4 As Integer
If ComboBox1.SelectedText = "Black" Then
band1 = 0
ElseIf ComboBox1.SelectedText = "Brown" Then
band1 = 1
ElseIf ComboBox1.SelectedText = "Red" Then
band1 = 2
ElseIf ComboBox1.SelectedText = "Orange" Then
band1 = 3
ElseIf ComboBox1.SelectedText = "Yellow" Then
band1 = 4
ElseIf ComboBox1.SelectedText = "Green" Then
band1 = 5
ElseIf ComboBox1.SelectedText = "Blue" Then
band1 = 6
ElseIf ComboBox1.SelectedText = "Violet" Then
band1 = 7
ElseIf ComboBox1.SelectedText = "Gray" Then
band1 = 8
ElseIf ComboBox1.SelectedText = "White" Then
band1 = 9
End If
If ComboBox2.SelectedText = "Black" Then
band2 = 0
ElseIf ComboBox2.SelectedText = "Brown" Then
band2 = 1
ElseIf ComboBox2.SelectedText = "Red" Then
band2 = 2
ElseIf ComboBox2.SelectedText = "Orange" Then
band2 = 3
ElseIf ComboBox2.SelectedText = "Yellow" Then
band2 = 4
ElseIf ComboBox2.SelectedText = "Green" Then
band2 = 5
ElseIf ComboBox2.SelectedText = "Blue" Then
band2 = 6
ElseIf ComboBox2.SelectedText = "Violet" Then
band2 = 7
ElseIf ComboBox2.SelectedText = "Gray" Then
band2 = 8
ElseIf ComboBox2.SelectedText = "White" Then
band2 = 9
End If
If ComboBox3.SelectedText = "Black" Then
band3 = 1
ElseIf ComboBox2.SelectedText = "Brown" Then
band3 = 10
ElseIf ComboBox2.SelectedText = "Red" Then
band3 = 100
ElseIf ComboBox2.SelectedText = "Orange" Then
band3 = 1000
ElseIf ComboBox2.SelectedText = "Yellow" Then
band3 = 10000
ElseIf ComboBox2.SelectedText = "Green" Then
band3 = 100000
ElseIf ComboBox2.SelectedText = "Blue" Then
band3 = 1000000
ElseIf ComboBox2.SelectedText = "Violet" Then
band3 = 10000000
ElseIf ComboBox2.SelectedText = "Gray" Then
band3 = 100000000
ElseIf ComboBox2.SelectedText = "White" Then
band3 = 1000000000
End If
Dim frontnum As Integer
If ComboBox4.SelectedText = "Gold" Then
band4 = "+/- 5 %"
txt_tolerance.Text = band4
ElseIf ComboBox4.SelectedText = "Silver" Then
band4 = "+/- 15% %"
txt_tolerance.Text = band4
ElseIf ComboBox4.SelectedText = "No band" Then
band4 = "+/- 20 %"
txt_tolerance.Text = band4
End If
frontnum = band1 & band2
txt_resistance.Text = frontnum * band3
End Sub
End Class

I don't know why, but this seems like a great place to use an enum... Maybe you can somehow reduce code?
Public Enum Band1 As Byte
Black = 0
Brown = 1
Red = 2
Orange = 3
Yellow = 4
Green = 5
Blue = 6
Violet = 7
Gray = 8
White = 9
End Enum
Public Enum Band2 As Byte
Black = 0
Brown = 1
Red = 2
Orange = 3
Yellow = 4
Green = 5
Blue = 6
Violet = 7
Gray = 8
White = 9
End Enum
Public Enum Band3 As Integer
Black = 1
Brown = 10
Red = 100
Orange = 1000
Yellow = 10000
Green = 100000
Blue = 1000000
Violet = 10000000
Gray = 100000000
White = 1000000000
End Enum
Public Enum Band4 As Byte
Gold = 5
Silver = 15
NoBand = 20
End Enum
“If you want something you've never had, you need to do something you've never done.”
Don't forget to mark
helpful posts and answers
! Answer an interesting question? Write a
new article
about it! My Articles
*This post does not reflect the opinion of Microsoft, or its employees.

Similar Messages

  • Suddenly on sunday while i was working, my macbook Air stopped working, right after that i tried getting it on but nothing came other than a grey screen with a question mark right in the center could you please help me in rectifying the problem. Would th

    Suddenly on Sunday while i was working, my macbook Air which i bought last year in Spetember from Arkansas, Little Rock stopped working, right after that i tried getting it on but nothing came other than a grey screen with a question mark right in the center. Could someone please help me in rectifying the problem. Would thi issue also affect saved data. However, I have handed the notebook to Apple for reapirs and they will revert by Thursday 12/04/2012.

    I just received some horrifying news from Adobe about my production suite.  I just FINALLY learned today that what I've been trying to do for over a week now - CAN'T be done because of compatability issues involving updates of both Adobe & Microsucks Winders!!!  I sincerely hope this is not your problem.  Mine is ALMOST HOPELESS!!  Being in this HOPELESS Obamma economy,,,, leaves NO STIMULUS in which to currently upgrade everything that needs upgraded for me to fully use my INVESTMENT in Adobe Suite - sad, horrible and SICKENING!!!
    I just wanted to post this. And again, I truly hope you find a solution. Good Luck!

  • Please help me to solve the issue in my query.

    Hi All,
    Please help me to understand the mistake what i did in below query and help to resolve that.
    Actually i am trying to create a query to filter the records from db based on my input parameter.
       If my input parameter is 1(@showallrecords) then i need to show all the records which has the IsLatest as 1
       If my input parameter is 0(@showallrecords) then i need to show all the records which has the IsLatest as 0
    select * from tabel1 INNER JOIN tabel2    
    ON tabel1.KeyId = tabel2.KeyId 
    and (@showallrecords = 1 and tabel1.IsLatest = 1 )
    and (@showallrecords = 0 and tabel1.IsLatest = 0 )
    when i am executing the above query with the parameter @showallrecords = 1 ,db is returning 0 rows.If i am executing the above query after removed the last line and (@showallrecords = 0 and tabel1.IsLatest = 0 ) then records are coming.
    i understand that 1=0(last line) and the condition is not true.So its affecting the result.
    Please help me to solve this.

    select * from tabel1 INNER JOIN tabel2
    ON tabel1.KeyId = tabel2.KeyId
    WHERE (tabel1.IsLatest = @showallrecords Or @showallrecords=0)

  • My ipad air getting close all apps automatically within seconds while connecting wifi. This issue is started after the updation of the iSO 8, Please help me to rectify this issue.

    Hi,
    My ipad air getting close all apps automatically within seconds while connecting wifi. This issue is started after the updation of the iSO 8, Please help me to rectify this issue.
    Expecting some quick solution in this regard,
    Thanks
    Prabhu

    (A) Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.
    (B) Try reset all settings
    Settings>General>Reset>Reset All Settings
    Note: Data will not be affected but settings for Wi-Fi, FaceTime, Message, Home Sharing will be reset

  • I installed windows 7 on my macbook pro. all is working but lan adaptor and sound od laptop is not working. please help me or send the link where i can download the these drivers.

    I installed windows 7 on my macbook pro. all is working but lan adaptor and sound od laptop is not working. please help me or send the link where i can download the these drivers.I have lost my resource cd .

    If you are running Lion or Mountain Lion, the drivers are downloaded from within Bootcamp Assistant. If you are running Snow Leopard the drivers are on your Snow Leopard install disk.
    Read the Bootcamp Install Guide for your version of OSx. http://www.apple.com/support/bootcamp/
    Bootcamp questions should be asked in the Bootcamp forum where the Bootcamp gurus hang out https://discussions.apple.com/community/windows_software/boot_camp

  • PLEASE HELP ME TO FIND THE SOLUTION REGARDING "LOGICAL SYSTEM CHANGED"

    HAI EVERYBODY,
    PLEASE HELP ME TO FIND THE SOLUTION REGARDING "LOGICAL SYSTEM CHANGED" during the material master replication by using middleware parameters.
    step1 : i have taken SRM client 810 and named it as CHINNISRM
    step2 : i  have taken r3 client 810 and named it as CHINNIR3
    step3: During material master replication i maintained tables like crmconsum,crmrfcpar,crmparoltp in   r3   and smofparsfa in srm client and filtered the objects and loaded the objects through r3ac3,r3ac1,r3as.
    step4 : And later i have checked in r3 queues to activate the objects,but i have seen a message like  "LOGICAL SYSTEM CHANGED:SEE 588701".according to the oss instructions i have checked in CRMPRLS table in se16 in R3 .there i found out there is one logical client  named with T90CLNT810.
    oss :588701
    Solution
    There are different cases in which different forms of processing are
    required or where several options exist:
    - The logical system name of an R/3 Backend client was changed in
    current operation. In this case, the data hangs in the outbound
    queues of the R/3 Backend system as specified under point 1 of
    the symptom. In this case, the logical system name must be
    changed back to the original value. Then the outbound queues
    can be reactivated. If no data was transferred to the EBP/CRM
    server before the change, also a correctioin of the check table
    is possible.
    - The same logical system name was used again in a new client of
    an R/3 Backend system that was linked to the EBP/CRM server. In
    this case, the data is in the inbound queue of the EBP/CRM
    server with the exception GUID_FOR_LOGSYS_CHANGED. In this
    case, the queue entries which have status SYSFAIL must be rejected, however, not the entire queues. If the new client of  the R/3 Backend system you have linked has exactly the same
    data as the old client and if it is meant to replace the old
    client (that is, this was deactivated), also a correction of
    the check tables is possible. In this case, the inbound queues
    can be reactivated after the correction.
    oss:765018
    1. If the situation in your system corresponds to the situation described
    under "Reason and Prerequisites" and if symptom 1 occurs, you can
    delete the table entry from table CRMPRLS table (there is just one
    entry). Since there is no maintenance dialog for this table and you
    cannot maintain it using transaction SE16, you must use a report to
    delete it. This report is attached to this note as correction
    instructions.
    Create the report ZZ_DELETE_CRMPRLS in your system and copy the source
    code from the correction instructions. You cannot implement this
    source code using transaction SNOTE.
    You can use the report in every plug-in or plug-in basis system, even
    if it is not specified in the validity section.
    After you have run the report, you can trigger existing queues again
    in transaction SMQ1.
    2. If the situation in your system corresponds to the situation described
    under "Reason and prerequisite" and if symptom 2 occurs, you can
    delete the entry from table CRMMLSGUID (there is just one entry).
    Since there is no maintenance entry for this table and you cannot
    maintain it using transaction SE16, you must use a report to delete
    it. This report is attached to this note as correction instructions.
    If they do not yet exist, add the following messages to message class SMOF in your logon language:
    Message Message short text
    303 User &1 is not allowed to change table &2.
    304 User &1 IS not allowed to display table &2.
    305 Logical system &1 was not found in table &2.
    306 System error! The current client was not
    found in table T000.
    Create the report ZZ_DELETE_CRMMLSGUID in your system and copy the
    source code from the correction instructions. You cannot implement
    this source code using transaction SNOTE.
    You can use the report for every release of the CRM system, even if it
    is not specified in the validity section. The only exceptions are CRM
    releases with Support Package versions that are too low such as CRM
    Release 3.0 with Support Package 12.
    After you have run the report, you can trigger existing queues again
    in transaction SMQ1 of the R/3 back-end system or transaction SMQ2 of
    the CRM system.
    so what should i do to do the replication.please suggest me .untill and unless i solve my problem i cant move to the further activity.i hope you people can solve my problem.thanks in advance.
    thanks and best regards,
    n.chakradhar

    Hi chakradhar,
    Did you find a solution to your issue? We are facing a similar issue and looking to figure out how this can be resolved.
    BR// 420

  • Good day please help me, my iphone 5 wont turn on.  i have tried the hard reset . but that didnt even work. i plugged it in charger but still no response i connect it in itunes still.dont open. please help. i dont have the warranty anymore, i

    good day please help me, my iphone 5 wont turn on.  i have tried the hard reset . but that didnt even work. i plugged it in charger but still no response i connect it in itunes still.dont open. please help. i dont have the warranty anymore, so please help.me.

    Please make a Genius Appointment and take it in for service. By now it probably cannot be fixed, but you never know.

  • HT1918 I would like to change my Visa card from the account but its not changing and the billing information is not changing and I can't purchase any thing from my account its now not usable please help me to solve the problem

    I would like to change my Visa card from the account but its not changing and the billing information is not changing and I can't purchase any thing from my account its now not usable please help me to solve the problem

    You made a purchase and exhausted the credit on your card before it processed. All purchases are final. Contact iTunes Store support. You need to settle up before you can purchase or download anything else.

  • Need driver for canon mg 5250 as scanner is not working with version 10.7. Can you please help me to find the driver so scanner works with WIFI?

    need driver for canon mg 5250 as scanner is not working with version 10.7. Lion. Can you please help me to find the driver so scanner works with WIFI?

    Try with the latest Apple driver package for Canon (released 15th Feb):
    http://support.apple.com/kb/DL899
    This solved my problem with the printing.

  • Please help me ,i forgot the synchronising password for my mac pro lion backup disk

    please help me ,i forgot the synchronising password for my mac pro lion backup disk

    If the backup volume is encrypted, and you forgot the password, then you'll have to erase the volume and start a new backup. There's no way to recover the password.

  • I want to check the main diffrence in Pop up block enabled and disabled.But,i don't get any difference.Would u please help me to understand the difference using one practical example of website

    I want to check the main diffrence in Pop up block enabled and disabled.But,i don't get any difference.Would u please help me to understand the difference using one practical example of website

    Here's two popup test sites.
    http://www.kephyr.com/popupkillertest/test/index.html
    http://www.popuptest.com/

  • Can you please help to understand how the firefox decides on the Expires date for a cached javascript file ( my server did not set any Expire header, but firebox set it down).

    # Question
    Can you please help to understand how the firefox decides on the Expires date for a cached javascript file ( my server did not set any Expire header, but firebox set it down). I tried to understand but different javascript file gets different Expires date value when it is being cached. Please help me as I tried lot and could not get proper answer for this. Thanks in Advance.

    Try posting at the Web Development / Standards Evangelism forum at MozillaZine. The helpers over there are more knowledgeable about web page development issues with Firefox. <br />
    http://forums.mozillazine.org/viewforum.php?f=25 <br />
    You'll need to register and login to be able to post in that forum.

  • Please help me in resolving the URL with parameters.

    Hello,
    Please help me in resolving the URL with parameters. If desformat is pdf, a pop up message �Acrobat Reader could not open �pa034922.fdf� because it is either not a supported file type or because the file has been corrupted���.
    if desformat is html or xml, the following URL is working.
    our requirement, report should be in pdf format.
    http://servername:7778/dev60cgi/rwcgi60?server=Rep60_mclaren&&userid=bizsystest/test@business&destype=cache&desformat=pdf&report=salary_dept.rdf&p_dept_list=''ABE','ASE','CE','CHE','CS','DE','DIAL','ECE','ERC','IE','ME','PTE','ARC','ASE1''&p_status_list=''ACP','AD','AP','ATP','D','FE','HD','INS','P','RP','S','TF','TP','TS','ST','GS','O''&p_sex=''M','F''&p_order_by='Name'&p_totals='NO'
    Thanks in advance,
    Usha

    We've seen this bug on machines running IE6 with a certain security patch (I forget its number). There's a thread in the Metalink reports forum about it. It appears to be somewhat tied to another problem where IE runs the report twice (you can see that in Showjobs. You're seeing the problem in 6i; I believe it persists in 9i.
    The workarounds are (1) set Acrobat so it doesn't open within IE or (2) switch to a different browser, like Netscape. For workaround 1, Start Acrobat Reader, Choose File -> Preferences -> General, Uncheck Web Browser Integration
    There's some evidence that it occurs more often with urls that include single quote characters. I think it's worse with XP, but I don't have any proof.
    If you check Adobe's site, you will see this isn't just an Oracle Reports problem. I think we're waiting for Microsoft on this one, so don't hold your breath for a quick fix.
    -- jim

  • HT5622 Please help I've lost the question and answer confidential My Account

    Please help I've lost the question and answer confidential My Account

    Hi Saad al saad,
    If you are having an issue with the Security Questions for your Apple ID, you may find the following articles helpful:
    Apple ID: All about Apple ID security questions
    http://support.apple.com/kb/HT5665
    Apple Support: Rescue email address and how to reset Apple ID security questions
    http://support.apple.com/kb/ht5312
    Regards,
    - Brenden

  • Please help I've lost the question and answer confidential My Account

    Please help I've lost the question and answer confidential My Account

    If you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then the steps half-way down this page should let you reset them : http://support.apple.com/kb/HT5312
    If you don't have a rescue email address (you won't be able to add one until you can answer 2 of your questions) then you will need to contact iTunes Support / Apple to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699
    When they've been reset (and if you don't already have a rescue email address) you can then use the steps half-way down the HT5312 link above to add a rescue email address for potential future use

Maybe you are looking for

  • Compare two pdfs in livecycle designer

    Does anyone know how to compare 2 pdfs in livecycle. So basically what I want is highlight the differences between 2 pdfs. If anyone has any idea it will be really helpful. Thanks.

  • How can I fix my iPod when Every time I watch a movie it pauses.

    When ever I try to watch Percy Jackson the lightning theft on my iPod that I bought from iTunes it always pauses every 10-30 seconds.

  • E-Recruitment position search

    Hi all, When i try to search for positions on creating a requisition it doesn´t return results. Am i doing anything wrong? This happens when i do the following: 1. Press 'Draft and Foward' 2. Create requisition 3. Change to tab Organizational Data 4.

  • What to do when Dr. Pepper is spilled on Macbook Air?

    How did this happen? I had an almost-empty glass of Dr. Pepper sitting beside my computer (stupid decision to leave it there, I know,) and my dog was laying beside me.  I was on iTunes about to sync some music I had just added to my library to my iPh

  • Taskflow region page full browser stretch

    how can i display contents of a page built using dropping a task flow as region on page in full browser window. how can i stretch the region to be displayed in full browser. My page has a panel form layout, does having a panel form layout cause probl