Hi Good Guys,
I have been asked to update VB6 coding to VBNET2008. I am curious about the command GOTO even thought I have used it I did not test the coding yet.
Before I test it, Please let me know it is ok to use GOTO command
Here are the VBNET2008 coding:
Code:'validate pagEdit data Private Function FCheckData() As Boolean Dim bolFlag As Boolean = True Dim strmsg As String Try If Me.txtOrderID.TextLength = 0 Then bolFlag = False Me.txtOrderID.Focus() GoTo FExit End If If lblOrderDate.Text = "" Then bolFlag = False strmsg = "Order Date is missing" Me.btnOrdDte.Focus() GoTo FExit End If If lblReqDate.Text = "" Then bolFlag = False strmsg = "Required Date is missing" Me.btnReqDte.Focus() GoTo FExit End If Catch ex As Exception MessageBox.Show(ex.Message) Finally bolEdit = bolFlag End Try FExit: If bolFlag = False Then MessageBox.Show(strmsg, "Update Cancelled ", MessageBoxButtons.OK) End If Return bolFlag End Function
Have a Good Day.
Cheers,
Lennie




Reply With Quote