/ Published in: Visual Basic
Expand |
Embed | Plain Text
Select Case decPostDiscoutCost Case Is <= 1000D IntConfirmExit = MessageBox.Show("This amount qualifies for A100 frequent flier miles.", _ "", _ MessageBoxButtons.OK, _ MessageBoxIcon.Information, _ MessageBoxDefaultButton.Button1) If IntConfirmExit = vbOK Then Me.Close() End If Case 1000D To 1500D IntConfirmExit = MessageBox.Show("This amount qualifies for B500 frequent flier miles.", _ "", _ MessageBoxButtons.OK, _ MessageBoxIcon.Information, _ MessageBoxDefaultButton.Button1) If IntConfirmExit = vbOK Then Me.Close() End If Case 1500D To 2500D IntConfirmExit = MessageBox.Show("This amount qualifies for C750 frequent flier miles.", _ "", _ MessageBoxButtons.OK, _ MessageBoxIcon.Information, _ MessageBoxDefaultButton.Button1) If IntConfirmExit = vbOK Then Me.Close() End If Case Is > 2500D IntConfirmExit = MessageBox.Show("This amount qualifies for D850 frequent flier miles.", _ "", _ MessageBoxButtons.OK, _ MessageBoxIcon.Information, _ MessageBoxDefaultButton.Button1) If IntConfirmExit = vbOK Then Me.Close() End If End Select
Comments
Subscribe to comments
You need to login to post a comment.

Wouldn't it be more legible to refactor it to the following:
hmmm... something went a bit wrong there. here's the complete listing...
Dim strMileCount As String
Select Case decPostDiscoutCost Case Is 2500D strMileCount = "D850"
End Select
strMileCount = "This amount qualifies for " & strMileCount & " frequent flier miles." IntConfirmExit = MessageBox.Show(strMileCount, _ "", _ MessageBoxButtons.OK, _ MessageBoxIcon.Information, _ MessageBoxDefaultButton.Button1)
If IntConfirmExit = vbOK Then Me.Close() End If