Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.
'Check to make sure the Current Department already exisits Dim Count2 As Integer = 0 Using Connection As New OleDbConnection _ ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Comet 631 Databases\Converted to 2003\C022008.mdb") Dim cmd As OleDbCommand = New OleDbCommand _ ("Select Count(ActAcct) as ExistingRecords From [SHACT] where (ActAcct)= @CurrDepart", Connection) cmd.Parameters.AddWithValue("@CurrDepart", Me.txtCurGL.Text.ToString & "%") Connection.Open() Count2 = CInt(cmd.ExecuteScalar) ("@CurrDepart",me.txtCurGL.text.Tostring & "%")end withconnection.open() End Using 'if the Current Department doesn't exisit then throw message and exit sub If Count2 <= 0 Then MessageBox.Show("The GL Department " & Me.txtCurGL.Text.ToString & " does not exisit.", _ "Copy Department", MessageBoxButtons.OK) Me.txtCurGL.Focus() Me.txtCurGL.SelectAll() Return End If
Join the community of 500,000 technology professionals and ask your questions.