Public Function GetCAccount() As Double Dim value As String For Each myrow As DataRow In myDataSet.Tables("AcquiredPositionsTbl").Rows If myrow("symbol").trim() = "CAccount" Then value = myrow("units") Return Double.Parse(value) End If Next MessageBox.Show("holy Batkeyboard! could not find 'CAccount'. I reset the portfolio with the initial CAccount.", "Reset portfolio", MessageBoxButtons.OK, MessageBoxIcon.Warning) UploadPosition("CAccount", GetInitialCAccount()) Globals.Ribbons.RibbonST.AcquiredPositionsBtn_Click(Nothing, Nothing) Return GetInitialCAccount() End Function