Click here to Skip to main content
15,885,435 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
VB
Dim PlayaSeptemberWeekday As Integer = "100"

    Dim PlayaSeptemberWeekend As Integer = "150"

    Private Sub cmbHotel_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbHotel.SelectedIndexChanged

        If (cmbHotel.Text = "Playa del Mar") And (cmbMonth.Text = "September") Then
            txtWeekday.Text = PlayaSeptemberWeekend
        
        End If


    End Sub


    Private Sub cmbWeekdays_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cmbWeekdays.SelectedIndexChanged

        Dim cmbWeekdays As Integer = "2" Or "3" Or "4" Or "5" Or "1"

        If cmbWeekdays = "1" Then
            txtWeekday.Text = cmbWeekdays * PlayaSeptemberWeekday

        End If

    End Sub

    
End Class



Basically I have a combo box, and I need to make it when a 1 or 2 or 3 or 4 or 5 is selected in the combobox I need it to multiply by 100. Anyone know where I'm going wrong here??
Posted
Updated 19-Nov-15 6:48am
v2
Comments
Richard MacCutchan 19-Nov-15 12:40pm    
You have not explained what the problem is.
Member 12150503 19-Nov-15 12:53pm    
The problem is that they don't multiply, when I have a eg. 2 selected in combo box and 100 is displayed in the text box, the dont multiply.
Richard MacCutchan 19-Nov-15 12:58pm    
Yes, but you are only doing the multiplication if cmbWeekdays equals 1, so the answer will only ever be 100.
Member 12150503 19-Nov-15 13:00pm    
I just put in cmbWeekdays = "1" or "2" Or "3" Or "4" Or "5"
and now im getting an answer of 700, no matter what number I press in the combo box :(
Matt T Heffron 19-Nov-15 13:03pm    
What does cmbWeekdays = "1" or "2" Or "3" Or "4" Or "5" actually do?
It sets cmbWeekdays to the integer value of the bitwise OR of those values. That number is 7

1 solution

You need some serious reading of the language documentation/tutorials.

Your code look like if you throw almost random pieces of code and get surprised it don't work. I see at least 6 errors in your code.

I guess you need to improve your programming skills too.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900