Re: Select Case Statement
Hi,
No. But the correct method is not clear from your posting. I think you want
VB Code:
Select Case True
Case Me.WholeRadioButton.Checked
MessageBox.Show("Wholesaler")
Case Else
MessageBox.Show("Retailer")
End Select
Re: Select Case Statement
Thanks that is what I orginally thought. By selecting either wholesale or Retail the price changes. So I was try to figure out how to then calculate different prices charged in an If then statement.
Re: Select Case Statement
Hi,
OK, so:
VB Code:
Select Case True
Case Me.WholeRadioButton.Checked
ChargePrice=WholesalePrice
Case Else
ChargePrice = RetailPrice
End Select
Return ChargePrice
Re: Select Case Statement
But you wouldn't normally use Select Case where there are only two possibilities, If...Then...Else would be more usual. Select Case is really meant for situations where there are many choices. Though it will work perfectly well.
Re: Select Case Statement
Thanks Taxes, you really helped. It took me awhile studying your code to understand it. It was a big help for this newbie. I agree with you Super Sparks, this bit of code was only meant to help me learn how to combine the select case with an IF Else statement using radio buttons.
Re: Select Case Statement
Hi,
The excerpt of code you previously posted is not the same as you actually used.
You cannot check for numerical entry in the way you are trying. Look in the code bank at
http://www.vbforums.com/showthread.php?t=314936
Re: Select Case Statement
Quote:
Originally Posted by SuperSparks
But you wouldn't normally use Select Case where there are only two possibilities, If...Then...Else would be more usual. Select Case is really meant for situations where there are many choices. Though it will work perfectly well.
Agreed, but I was just staying with what he produced.