Below is my code.
I am getting and 'end of statement expected' error at the end of the line highlighted in red.
Can someone explain to me how I can fix my code to work?
![:whistling:](https://www.geekstogo.com/forum/public/style_emoticons/default/helpsmilie.gif)
-----------------------------------------------------------------------------------------------------------------------------
Private Sub uiCalcButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles uiCalcButton.Click
'calculates the discounted prices using discount rates of 10% through 30% in increments of 5%
'declare variables
Dim originalPrice As Double
Dim discountPrice As Double
Dim discountRate As Double
Try
'clear the contents of the uiDiscPricesLabel
Me.uiDiscPricesLabel.Text = ""
'if the text box contains data, then assign input to variable and display the discounted prices
DoWhile discountRate = 0.1 To 0.3 Step 0.05
(this is where i am getting the error - what is highlighted is what is showing up as part of the error)
discountPrice = originalPrice - originalPrice * discountRate
Me.uiDiscPricesLabel.Text = Me.uiDiscPricesLabel.Text _
& discountRate.ToString("P0") & " " _
& discountPrice.ToString("N2") & ControlChars.NewLine
Loop
IfMe.uiOriginalTextBox.Text <> "" Then
originalPrice = Double.Parse(Me.uiOriginalTextBox.Text)
Else
MessageBox.Show("Please enter the original price." "Shoppers haven", MessageBoxButtons.OK, _
MessageBoxIcon.Information)
EndIf
Catch ex As Exception
MessageBox.Show(ex.Message, "Shoppers Haven", MessageBoxButtons.OK, MessageBoxIcon.Information)
EndTry
'set the focus
Me.uiOriginalTextBox.Focus()
EndSub
Edited by Sparklies, 14 April 2006 - 11:50 PM.