'This source code has been developed by Cuong Pham (cuong@nmsu.edu) & Mary Lucero
'Any use of this software MUST contain this message
Public Class FrClones
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents CbPCRproduct As System.Windows.Forms.ComboBox
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents TxVector As System.Windows.Forms.TextBox
    Friend WithEvents Label6 As System.Windows.Forms.Label
    Friend WithEvents TxDateLigated As System.Windows.Forms.TextBox
    Friend WithEvents Label7 As System.Windows.Forms.Label
    Friend WithEvents TxMethodUsed As System.Windows.Forms.TextBox
    Friend WithEvents ckSuccess As System.Windows.Forms.CheckBox
    Friend WithEvents Label8 As System.Windows.Forms.Label
    Friend WithEvents TxDateTransformed As System.Windows.Forms.TextBox
    Friend WithEvents Label9 As System.Windows.Forms.Label
    Friend WithEvents TxCellLine As System.Windows.Forms.TextBox
    Friend WithEvents Label10 As System.Windows.Forms.Label
    Friend WithEvents TxGlycerolStockLocation As System.Windows.Forms.TextBox
    Friend WithEvents Label11 As System.Windows.Forms.Label
    Friend WithEvents TxInsertSize As System.Windows.Forms.TextBox
    Friend WithEvents Label12 As System.Windows.Forms.Label
    Friend WithEvents TxSeqFileName As System.Windows.Forms.TextBox
    Friend WithEvents Label16 As System.Windows.Forms.Label
    Friend WithEvents TxComments As System.Windows.Forms.TextBox
    Friend WithEvents ButAdd As System.Windows.Forms.Button
    Friend WithEvents ButUpdate As System.Windows.Forms.Button
    Friend WithEvents ButDelete As System.Windows.Forms.Button
    Friend WithEvents ButQuit As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.DataGrid1 = New System.Windows.Forms.DataGrid
        Me.Label1 = New System.Windows.Forms.Label
        Me.CbPCRproduct = New System.Windows.Forms.ComboBox
        Me.Label2 = New System.Windows.Forms.Label
        Me.TxVector = New System.Windows.Forms.TextBox
        Me.Label6 = New System.Windows.Forms.Label
        Me.TxDateLigated = New System.Windows.Forms.TextBox
        Me.Label7 = New System.Windows.Forms.Label
        Me.TxMethodUsed = New System.Windows.Forms.TextBox
        Me.ckSuccess = New System.Windows.Forms.CheckBox
        Me.Label8 = New System.Windows.Forms.Label
        Me.TxDateTransformed = New System.Windows.Forms.TextBox
        Me.Label9 = New System.Windows.Forms.Label
        Me.TxCellLine = New System.Windows.Forms.TextBox
        Me.Label10 = New System.Windows.Forms.Label
        Me.TxGlycerolStockLocation = New System.Windows.Forms.TextBox
        Me.Label11 = New System.Windows.Forms.Label
        Me.TxInsertSize = New System.Windows.Forms.TextBox
        Me.Label12 = New System.Windows.Forms.Label
        Me.TxSeqFileName = New System.Windows.Forms.TextBox
        Me.Label16 = New System.Windows.Forms.Label
        Me.TxComments = New System.Windows.Forms.TextBox
        Me.ButAdd = New System.Windows.Forms.Button
        Me.ButUpdate = New System.Windows.Forms.Button
        Me.ButDelete = New System.Windows.Forms.Button
        Me.ButQuit = New System.Windows.Forms.Button
        CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'DataGrid1
        '
        Me.DataGrid1.DataMember = ""
        Me.DataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.DataGrid1.Location = New System.Drawing.Point(0, 0)
        Me.DataGrid1.Name = "DataGrid1"
        Me.DataGrid1.Size = New System.Drawing.Size(752, 252)
        Me.DataGrid1.TabIndex = 0
        '
        'Label1
        '
        Me.Label1.Location = New System.Drawing.Point(8, 261)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(104, 27)
        Me.Label1.TabIndex = 1
        Me.Label1.Text = "Insert"
        '
        'CbPCRproduct
        '
        Me.CbPCRproduct.Location = New System.Drawing.Point(128, 263)
        Me.CbPCRproduct.Name = "CbPCRproduct"
        Me.CbPCRproduct.Size = New System.Drawing.Size(168, 21)
        Me.CbPCRproduct.TabIndex = 2
        Me.CbPCRproduct.Text = "ComboBox1"
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(9, 290)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(112, 24)
        Me.Label2.TabIndex = 3
        Me.Label2.Text = "Vector"
        '
        'TxVector
        '
        Me.TxVector.Location = New System.Drawing.Point(128, 291)
        Me.TxVector.Name = "TxVector"
        Me.TxVector.Size = New System.Drawing.Size(168, 20)
        Me.TxVector.TabIndex = 4
        Me.TxVector.Text = "TextBox1"
        '
        'Label6
        '
        Me.Label6.Location = New System.Drawing.Point(8, 320)
        Me.Label6.Name = "Label6"
        Me.Label6.Size = New System.Drawing.Size(112, 24)
        Me.Label6.TabIndex = 11
        Me.Label6.Text = "Date Ligated"
        '
        'TxDateLigated
        '
        Me.TxDateLigated.Location = New System.Drawing.Point(128, 320)
        Me.TxDateLigated.Name = "TxDateLigated"
        Me.TxDateLigated.Size = New System.Drawing.Size(168, 20)
        Me.TxDateLigated.TabIndex = 12
        Me.TxDateLigated.Text = "TextBox1"
        '
        'Label7
        '
        Me.Label7.Location = New System.Drawing.Point(8, 352)
        Me.Label7.Name = "Label7"
        Me.Label7.Size = New System.Drawing.Size(104, 24)
        Me.Label7.TabIndex = 13
        Me.Label7.Text = "Method Used"
        '
        'TxMethodUsed
        '
        Me.TxMethodUsed.Location = New System.Drawing.Point(128, 352)
        Me.TxMethodUsed.Name = "TxMethodUsed"
        Me.TxMethodUsed.Size = New System.Drawing.Size(168, 20)
        Me.TxMethodUsed.TabIndex = 14
        Me.TxMethodUsed.Text = "TextBox1"
        '
        'ckSuccess
        '
        Me.ckSuccess.Location = New System.Drawing.Point(128, 384)
        Me.ckSuccess.Name = "ckSuccess"
        Me.ckSuccess.Size = New System.Drawing.Size(176, 24)
        Me.ckSuccess.TabIndex = 15
        Me.ckSuccess.Text = "Success"
        '
        'Label8
        '
        Me.Label8.Location = New System.Drawing.Point(336, 264)
        Me.Label8.Name = "Label8"
        Me.Label8.Size = New System.Drawing.Size(96, 24)
        Me.Label8.TabIndex = 16
        Me.Label8.Text = "Date Transformed"
        '
        'TxDateTransformed
        '
        Me.TxDateTransformed.Location = New System.Drawing.Point(432, 262)
        Me.TxDateTransformed.Name = "TxDateTransformed"
        Me.TxDateTransformed.Size = New System.Drawing.Size(158, 20)
        Me.TxDateTransformed.TabIndex = 17
        Me.TxDateTransformed.Text = "TextBox1"
        '
        'Label9
        '
        Me.Label9.Location = New System.Drawing.Point(336, 291)
        Me.Label9.Name = "Label9"
        Me.Label9.Size = New System.Drawing.Size(88, 21)
        Me.Label9.TabIndex = 18
        Me.Label9.Text = "Cell Line"
        '
        'TxCellLine
        '
        Me.TxCellLine.Location = New System.Drawing.Point(432, 288)
        Me.TxCellLine.Name = "TxCellLine"
        Me.TxCellLine.Size = New System.Drawing.Size(160, 20)
        Me.TxCellLine.TabIndex = 19
        Me.TxCellLine.Text = "TextBox1"
        '
        'Label10
        '
        Me.Label10.Location = New System.Drawing.Point(296, 322)
        Me.Label10.Name = "Label10"
        Me.Label10.Size = New System.Drawing.Size(128, 24)
        Me.Label10.TabIndex = 20
        Me.Label10.Text = "Glycerol Stock Location"
        '
        'TxGlycerolStockLocation
        '
        Me.TxGlycerolStockLocation.Location = New System.Drawing.Point(432, 320)
        Me.TxGlycerolStockLocation.Name = "TxGlycerolStockLocation"
        Me.TxGlycerolStockLocation.Size = New System.Drawing.Size(160, 20)
        Me.TxGlycerolStockLocation.TabIndex = 21
        Me.TxGlycerolStockLocation.Text = "TextBox1"
        '
        'Label11
        '
        Me.Label11.Location = New System.Drawing.Point(336, 352)
        Me.Label11.Name = "Label11"
        Me.Label11.Size = New System.Drawing.Size(88, 24)
        Me.Label11.TabIndex = 22
        Me.Label11.Text = "Insert Size"
        '
        'TxInsertSize
        '
        Me.TxInsertSize.Location = New System.Drawing.Point(432, 352)
        Me.TxInsertSize.Name = "TxInsertSize"
        Me.TxInsertSize.Size = New System.Drawing.Size(160, 20)
        Me.TxInsertSize.TabIndex = 23
        Me.TxInsertSize.Text = "TextBox1"
        '
        'Label12
        '
        Me.Label12.Location = New System.Drawing.Point(336, 386)
        Me.Label12.Name = "Label12"
        Me.Label12.Size = New System.Drawing.Size(80, 24)
        Me.Label12.TabIndex = 24
        Me.Label12.Text = "Sequence File"
        '
        'TxSeqFileName
        '
        Me.TxSeqFileName.Location = New System.Drawing.Point(432, 384)
        Me.TxSeqFileName.Name = "TxSeqFileName"
        Me.TxSeqFileName.Size = New System.Drawing.Size(160, 20)
        Me.TxSeqFileName.TabIndex = 25
        Me.TxSeqFileName.Text = "TextBox1"
        '
        'Label16
        '
        Me.Label16.Location = New System.Drawing.Point(10, 416)
        Me.Label16.Name = "Label16"
        Me.Label16.Size = New System.Drawing.Size(88, 24)
        Me.Label16.TabIndex = 32
        Me.Label16.Text = "Comments"
        '
        'TxComments
        '
        Me.TxComments.Location = New System.Drawing.Point(129, 417)
        Me.TxComments.Name = "TxComments"
        Me.TxComments.Size = New System.Drawing.Size(464, 20)
        Me.TxComments.TabIndex = 33
        Me.TxComments.Text = "TextBox1"
        '
        'ButAdd
        '
        Me.ButAdd.Location = New System.Drawing.Point(600, 264)
        Me.ButAdd.Name = "ButAdd"
        Me.ButAdd.Size = New System.Drawing.Size(144, 40)
        Me.ButAdd.TabIndex = 34
        Me.ButAdd.Text = "Add Clone"
        '
        'ButUpdate
        '
        Me.ButUpdate.Location = New System.Drawing.Point(600, 310)
        Me.ButUpdate.Name = "ButUpdate"
        Me.ButUpdate.Size = New System.Drawing.Size(144, 40)
        Me.ButUpdate.TabIndex = 35
        Me.ButUpdate.Text = "Update"
        '
        'ButDelete
        '
        Me.ButDelete.Location = New System.Drawing.Point(600, 357)
        Me.ButDelete.Name = "ButDelete"
        Me.ButDelete.Size = New System.Drawing.Size(144, 36)
        Me.ButDelete.TabIndex = 36
        Me.ButDelete.Text = "Delete"
        '
        'ButQuit
        '
        Me.ButQuit.Location = New System.Drawing.Point(602, 400)
        Me.ButQuit.Name = "ButQuit"
        Me.ButQuit.Size = New System.Drawing.Size(144, 40)
        Me.ButQuit.TabIndex = 37
        Me.ButQuit.Text = "Quit"
        '
        'FrClones
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(752, 454)
        Me.Controls.Add(Me.ButQuit)
        Me.Controls.Add(Me.ButDelete)
        Me.Controls.Add(Me.ButUpdate)
        Me.Controls.Add(Me.ButAdd)
        Me.Controls.Add(Me.TxComments)
        Me.Controls.Add(Me.Label16)
        Me.Controls.Add(Me.TxSeqFileName)
        Me.Controls.Add(Me.Label12)
        Me.Controls.Add(Me.TxInsertSize)
        Me.Controls.Add(Me.Label11)
        Me.Controls.Add(Me.TxGlycerolStockLocation)
        Me.Controls.Add(Me.Label10)
        Me.Controls.Add(Me.TxCellLine)
        Me.Controls.Add(Me.Label9)
        Me.Controls.Add(Me.TxDateTransformed)
        Me.Controls.Add(Me.Label8)
        Me.Controls.Add(Me.ckSuccess)
        Me.Controls.Add(Me.TxMethodUsed)
        Me.Controls.Add(Me.Label7)
        Me.Controls.Add(Me.TxDateLigated)
        Me.Controls.Add(Me.Label6)
        Me.Controls.Add(Me.TxVector)
        Me.Controls.Add(Me.Label2)
        Me.Controls.Add(Me.CbPCRproduct)
        Me.Controls.Add(Me.Label1)
        Me.Controls.Add(Me.DataGrid1)
        Me.Name = "FrClones"
        Me.Text = "Clones"
        CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

#End Region
    Dim ID As Integer
    Dim Mode As Integer
    Dim PCRproductID As Integer
    Private Sub ButQuit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButQuit.Click
        Me.Hide()
    End Sub
    Private Sub Load_Clones()
        On Error Resume Next
        Init()
        Dim SQLs As String
        Dim t As String

        Dim connString As String = strConn
        Dim myConnection As OleDb.OleDbConnection = New OleDb.OleDbConnection
        myConnection.ConnectionString = connString
        ' create a data adapter 
        SQLs = "SELECT CloneID,PCRproductID,Vector," & _
                " dateLigated,MethodUsed,Success,DateTransformed,CellLine,GlycerolStockLocation, " & _
                " InsertSize,SequenceFileName,Comments FROM CLONE ORDER BY cloneID"

        Dim da As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter(SQLs, myConnection)
        ' create a new dataset 
        Dim ds As DataSet = New DataSet
        ' fill dataset 
        da.Fill(ds, "CLONE")

        ' write dataset contents to an xml file by calling WriteXml method 
        ' Attach DataSet to DataGrid

        DataGrid1.DataSource = ds.DefaultViewManager
        DataGrid1.DataMember = "CLONE"
        DataGrid1.ColumnHeadersVisible = True
        DataGrid1.Refresh()
        myConnection.Close()


        CbPCRproduct.Items.Clear()
        FillComboBox(CbPCRproduct, "PCR_product", "Description")
        CbPCRproduct.Text = ""

        TxVector.Text = ""

        TxDateLigated.Text = ""
        TxMethodUsed.Text = ""
        ckSuccess.Checked = True
        TxDateTransformed.Text = ""
        TxCellLine.Text = ""
        TxGlycerolStockLocation.Text = ""
        TxInsertSize.Text = "0.0"
        TxSeqFileName.Text = ""
        TxComments.Text = ""
    End Sub

    Private Sub FrClones_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ShowToolTip()
        Load_Clones()
    End Sub
    Private Sub DataGrid1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DataGrid1.Click
        Dim i As Integer, s As String
        Dim t As Boolean
        t = False
        Flush()
        Mode = 1
        i = 0
        On Error Resume Next
        While (t = False)
            If DataGrid1.IsSelected(i) Then
                ID = DataGrid1.Item(i, 0)
                CbPCRproduct.Text = getName("PCR_product", "productID", "Description", CInt(DataGrid1.Item(i, 1)))
                TxVector.Text = DataGrid1.Item(i, 2)
                TxDateLigated.Text = DataGrid1.Item(i, 3)
                TxMethodUsed.Text = DataGrid1.Item(i, 4)
                ckSuccess.Checked = DataGrid1.Item(i, 5)
                TxDateTransformed.Text = DataGrid1.Item(i, 6)
                TxCellLine.Text = DataGrid1.Item(i, 7)
                TxGlycerolStockLocation.Text = DataGrid1.Item(i, 8)
                TxInsertSize.Text = DataGrid1.Item(i, 9)
                TxSeqFileName.Text = DataGrid1.Item(i, 10)
                TxComments.Text = DataGrid1.Item(i, 11)
                ButUpdate.Enabled = True
                ButDelete.Enabled = True
                t = True
            End If
            i = i + 1
        End While
    End Sub
    Private Sub ButUpdate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButUpdate.Click
        Dim strSQL As String
        Dim sSQL As String, t As String
        Dim productID As String

        On Error Resume Next
        OpenConn()

        If Mode = 0 Then
            productID = getID("PCR_product", "productID", "Description", CbPCRproduct.Text)
            sSQL = "INSERT INTO CLONE (PCRproductID,Vector," & _
                   "dateLigated,MethodUsed,Success,DateTransformed,CellLine,GlycerolStockLocation," & _
                   " InsertSize,SequenceFileName,Comments)" & _
            "  VALUES (" & CInt(productID) & _
            ",'" & TxVector.Text & _
            "','" & TxDateLigated.Text & _
            "','" & TxMethodUsed.Text & _
            "'," & ckSuccess.Checked & _
            ",'" & TxDateTransformed.Text & _
            "','" & TxCellLine.Text & _
            "','" & TxGlycerolStockLocation.Text & _
            "'," & CDbl(TxInsertSize.Text) & _
            ",'" & TxSeqFileName.Text & _
            "','" & TxComments.Text & "')"

            Dim myCommand As New OleDb.OleDbCommand(sSQL, myConnection)
            myCommand.Connection = myConnection

            myCommand.ExecuteNonQuery()
            myCommand.Dispose()

            Init()

            Dim myCon As OleDb.OleDbConnection = New OleDb.OleDbConnection
            myCon.ConnectionString = strConn
            ' create a data adapter 
            Dim da As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter("Select * FROM CLONE", myConnection)

            ' create a new dataset 
            Dim ds As DataSet = New DataSet
            ' fill dataset 
            da.Fill(ds, "CLONE")

            ' write dataset contents to an xml file by calling WriteXml method 
            ' Attach DataSet to DataGrid

            DataGrid1.DataSource = ds.DefaultViewManager
            DataGrid1.ColumnHeadersVisible = True
            DataGrid1.Refresh()

            da.Dispose()
            ds.Dispose()
            myCon.Close()

        End If

        If Mode = 1 Then
            productID = getID("PCR_product", "productID", "Description", CbPCRproduct.Text)

            strSQL = "UPDATE CLONE SET PCRproductID= " & CInt(productID) & _
                        ",Vector='" & TxVector.Text & _
                        "',DateLigated='" & TxDateLigated.Text & _
                        "',MethodUsed='" & TxMethodUsed.Text & _
                        "',Success=" & ckSuccess.Checked & _
                        ",DateTransformed='" & TxDateTransformed.Text & _
                        "',CellLine='" & TxCellLine.Text & _
                        "',GlycerolStockLocation='" & TxGlycerolStockLocation.Text & _
                        "',InsertSize=" & CDbl(TxInsertSize.Text) & _
                        ",SequenceFileName='" & TxSeqFileName.Text & _
                        "',Comments='" & TxComments.Text & _
                        "' WHERE  CloneID=" & ID

            Dim myCommand As New OleDb.OleDbCommand(strSQL)
            myCommand.Connection = myConnection
            myCommand.ExecuteNonQuery()
            myCommand.Dispose()

            DataGrid1.Item(DataGrid1.CurrentRowIndex, 0) = ID
            DataGrid1.Item(DataGrid1.CurrentRowIndex, 1) = productID
            DataGrid1.Item(DataGrid1.CurrentRowIndex, 2) = TxVector.Text
            DataGrid1.Item(DataGrid1.CurrentRowIndex, 3) = TxDateLigated.Text
            DataGrid1.Item(DataGrid1.CurrentRowIndex, 4) = TxMethodUsed.Text
            DataGrid1.Item(DataGrid1.CurrentRowIndex, 5) = ckSuccess.Checked
            DataGrid1.Item(DataGrid1.CurrentRowIndex, 6) = TxDateTransformed.Text
            DataGrid1.Item(DataGrid1.CurrentRowIndex, 7) = TxCellLine.Text
            DataGrid1.Item(DataGrid1.CurrentRowIndex, 8) = TxGlycerolStockLocation.Text
            DataGrid1.Item(DataGrid1.CurrentRowIndex, 9) = TxInsertSize.Text
            DataGrid1.Item(DataGrid1.CurrentRowIndex, 10) = TxSeqFileName.Text
            DataGrid1.Item(DataGrid1.CurrentRowIndex, 11) = TxComments.Text

        End If

        myConnection.Close()
    End Sub
    Private Sub Flush()

        CbPCRproduct.Text = ""
        TxVector.Text = "pCR2.1"
        TxDateLigated.Text = ""
        TxMethodUsed.Text = "TA CLONING"
        ckSuccess.Checked = True
        TxDateTransformed.Text = ""
        TxCellLine.Text = "TOP 10"
        TxGlycerolStockLocation.Text = "FREEZER (-80Oc)"
        TxInsertSize.Text = "730"
        TxSeqFileName.Text = ""
        TxComments.Text = "Probably all BGC_ clones are one of two sequences, 630 or 730 bps"

    End Sub
    Private Sub ShowToolTip()
        Dim toolTip1 As New ToolTip

        ' Set up the delays for the ToolTip.
        toolTip1.AutoPopDelay = 5000
        toolTip1.InitialDelay = 1000
        toolTip1.ReshowDelay = 500
        ' Force the ToolTip text to be displayed whether or not the form is active.
        toolTip1.ShowAlways = True

        ' Set up the ToolTip text for the Button and Checkbox.
        toolTip1.SetToolTip(Me.Label1, "PCR product that was ligated to the cloning vector")
        toolTip1.SetToolTip(Me.Label2, "Name of vector used for cloning (eg. pCR 2.1 etc.) ")
        toolTip1.SetToolTip(Me.Label6, "Date ligation was performed")
        toolTip1.SetToolTip(Me.Label7, "Cloning protocol (ie. TA cloning, etc.) ")

        toolTip1.SetToolTip(Me.ckSuccess, "Transformation efficiency")
        toolTip1.SetToolTip(Me.Label8, "Date that clones were plated on selective agar")
        toolTip1.SetToolTip(Me.Label10, "Clones preserved in 15% glycerol and location stored (ie. Freezer #1)")
        toolTip1.SetToolTip(Me.Label11, "How long is the insert in base pairs")
        toolTip1.SetToolTip(Me.Label12, "Once plasmid is sequenced, where that file is located")
        toolTip1.SetToolTip(Me.Label16, "Any further information needed on this particular clone or set of clones. Be sure to include the location of unused ligation products that might still be available if cloning was successful")

    End Sub

    Private Sub ButAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButAdd.Click

        CbPCRproduct.Text = ""
        TxVector.Text = "pCR2.1"
        TxDateLigated.Text = ""
        TxMethodUsed.Text = "TA CLONING"
        ckSuccess.Checked = True
        TxDateTransformed.Text = ""
        TxCellLine.Text = "TOP 10"
        TxGlycerolStockLocation.Text = "FREEZER (-80Oc)"
        TxInsertSize.Text = "730"
        TxSeqFileName.Text = ""
        TxComments.Text = "Probably all BGC_ clones are one of two sequences, 630 or 730 bps"
        ButUpdate.Enabled = True
        ButDelete.Enabled = False
        Mode = 0
        CbPCRproduct.Focus()
    End Sub

    Private Sub ButDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButDelete.Click
        On Error Resume Next
        Dim msg As String
        Dim title As String
        Dim style As MsgBoxStyle
        Dim response As MsgBoxResult
        msg = "Do you  really want to delete the Clone ID :" & ID & " ?"  ' Define message.
        style = MsgBoxStyle.DefaultButton2 Or _
           MsgBoxStyle.Critical Or MsgBoxStyle.YesNo
        title = "Delete Comfirmation"   ' Define title.
        ' Display message.
        response = MsgBox(msg, style, title)
        If response = MsgBoxResult.Yes Then   ' User chose Yes.

            strSQL = "DELETE FROM Clone WHERE cloneID=" & ID
            OpenConn()

            Dim myCommand As New OleDb.OleDbCommand(strSQL)
            myCommand.Connection = myConnection
            myCommand.ExecuteNonQuery()
            DataGrid1.Refresh()
            myCommand.Dispose()
            myConnection.Close()
            Load_Clones()
        Else
            ' Perform some other action.
        End If

    End Sub
End Class
