Hi Guys I hope there is someone out there that can point me in the right direction to clear up a bit of an issue I'm experiencing.
I have a select case statement that is based on a value in a combobox but it doesn't appear to be working as I'd expect
Here is the code:
dim selectedtext as string = Me.cboYear.Text
dim version as string = ""
Select Case selectedtext
Case selectedText = "2009"
version = "V1"
Case selectedtext = "2010"
version = "V2"
Case selectedtext = "2011"
version = "V3"
Case selectedtext = "2012"
version = "V4"
Case Else
version = "Unknown Version"
End Select
The code skips all the cases and sets the value of the version to "Unknown Version" despite selecting any of the other values in the combobox. I can't see anything glaringly obvious in the select case statement (although that I'll admit that it could be wrong) so I'm wondering if the combobox.text property is something I have misunderstood (also likely)
I'm using VS2010 on a vistabox
Any pointers would be much appreciated.
Thanks
I have a select case statement that is based on a value in a combobox but it doesn't appear to be working as I'd expect
Here is the code:
dim selectedtext as string = Me.cboYear.Text
dim version as string = ""
Select Case selectedtext
Case selectedText = "2009"
version = "V1"
Case selectedtext = "2010"
version = "V2"
Case selectedtext = "2011"
version = "V3"
Case selectedtext = "2012"
version = "V4"
Case Else
version = "Unknown Version"
End Select
The code skips all the cases and sets the value of the version to "Unknown Version" despite selecting any of the other values in the combobox. I can't see anything glaringly obvious in the select case statement (although that I'll admit that it could be wrong) so I'm wondering if the combobox.text property is something I have misunderstood (also likely)
I'm using VS2010 on a vistabox
Any pointers would be much appreciated.
Thanks