I am trying to make it read from the text file. the items from the text should be in an array. Then when the user types in the Abbreviation text box 2 letters it should try to find the state. Same for the State box to find the abbreviation. When I compile it, it tells me I need to declare "NEW" in my if statementfull sub belowCode:If .stateText.Text.ToUpper.Trim = USstate(indexInteger).stateNameString.ToUpper.Trim Then
Thanks for any comment or suggestions in advance
Code:Private Sub LookUpButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LookUpButton.Click Dim indexInteger As Integer Dim foundBoolean As Boolean With Me If .AbbreviationRadioButton.Checked = True Then Do Until foundBoolean Or indexInteger > 55 If .stateText.Text.ToUpper.Trim = USstate(indexInteger).stateNameString.ToUpper.Trim Then AbText.Text = USstate(indexInteger).abbrString foundBoolean = True Else indexInteger += 1 End If Loop If Not foundBoolean Then MessageBox.Show("the state could not be found", "No match", MessageBoxButtons.OK, MessageBoxIcon.Information) AbText.SelectAll() AbText.Focus() End If End If If .NameRadioButton.Checked = True Then Do Until foundBoolean Or indexInteger > 55 If .AbText.Text.ToUpper.Trim = USstate(indexInteger).abbrString.ToUpper.Trim Then Me.stateText.Text = USstate(indexInteger).stateNameString foundBoolean = True Else indexInteger += 1 End If Loop If Not foundBoolean Then MessageBox.Show("the state could not be found", "No match", MessageBoxButtons.OK, MessageBoxIcon.Information) stateText.SelectAll() stateText.Focus() End If End If End With End Sub End Class




Reply With Quote