Hi, i am pretty new to VB and i know this may be a simple question. please help. I have multiple text boxes that i need to validate for for numeric data. I want to return the focus for the specific text box, that is causing the problem, and select all. My code right now returns the focus to the last text box only. I cant figure out how to do it. here is my code.
Catch EX As FormatException
MessageBox.Show("Data must be Numeric.", "Data Entry Error", _
MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
With MonthlyGrossTextBox
.Focus()
.SelectAll()
End With
With CharityTextBox
.Focus()
.SelectAll()
End With
With ExpensesTextBox
.Focus()
.SelectAll()
End With
With SavingsTextBox
.Focus()
.SelectAll()
End With
With InvestmentsTextBox
.Focus()
.SelectAll()
End With
End Try
Catch EX As FormatException
MessageBox.Show("Data must be Numeric.", "Data Entry Error", _
MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
With MonthlyGrossTextBox
.Focus()
.SelectAll()
End With
With CharityTextBox
.Focus()
.SelectAll()
End With
With ExpensesTextBox
.Focus()
.SelectAll()
End With
With SavingsTextBox
.Focus()
.SelectAll()
End With
With InvestmentsTextBox
.Focus()
.SelectAll()
End With
End Try