Link to home
Start Free TrialLog in
Avatar of chrisryhal
chrisryhal

asked on

Pass Datagrid Value to a form

1)  I am filling a datagrid with the following values:

ID      Number          Description         Customer

2) I need the user to be able to doubleclick on the row of the datagrid, and it then open up a form, with text boxes, that the values are passed to for updating.

Any help?  
Avatar of chrisryhal
chrisryhal

ASKER

Datagrid Code:




Option Strict On

Imports System.Data.SqlClient

Public Class frmToolTracker_DataGrid
    Inherits System.Windows.Forms.Form

    Protected ProductData As New DataSet()


    Protected Const SQL_CONNECTION_STRING As String = _
        "Server=localhost;" & _
        "DataBase=Triumph;" & _
        "Integrated Security=SSPI"


    Protected didPreviouslyConnect As Boolean = False
    Protected connectionString As String = SQL_CONNECTION_STRING

    ' Used to reference the table containing product information in
    ' ProductData.
    Protected Const PRODUCT_TABLE_NAME As String = "TL_Tooling"

#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

        ' So that we only need to set the title of the application once,
        ' we use the AssemblyInfo class (defined in the AssemblyInfo.vb file)
        ' to read the AssemblyTitle attribute.
        Dim ainfo As New AssemblyInfo()

        Me.Text = ainfo.Title
        Me.mnuAbout.Text = String.Format("&About {0} ...", ainfo.Title)

    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 mnuMain As System.Windows.Forms.MainMenu
    Friend WithEvents mnuFile As System.Windows.Forms.MenuItem
    Friend WithEvents mnuExit As System.Windows.Forms.MenuItem
    Friend WithEvents mnuHelp As System.Windows.Forms.MenuItem
    Friend WithEvents mnuAbout As System.Windows.Forms.MenuItem
    Friend WithEvents btnFilter As System.Windows.Forms.Button
    Friend WithEvents txtFilter As System.Windows.Forms.TextBox
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents btnLoad As System.Windows.Forms.Button
    Friend WithEvents grdToolTracker As System.Windows.Forms.DataGrid
    Friend WithEvents mnuPrint As System.Windows.Forms.MenuItem
    Friend WithEvents mnuTooling As System.Windows.Forms.MenuItem
    Friend WithEvents mnuTooling_Edit As System.Windows.Forms.MenuItem
    Friend WithEvents mnuTooling_Add As System.Windows.Forms.MenuItem
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmToolTracker_DataGrid))
        Me.mnuMain = New System.Windows.Forms.MainMenu()
        Me.mnuFile = New System.Windows.Forms.MenuItem()
        Me.mnuPrint = New System.Windows.Forms.MenuItem()
        Me.mnuExit = New System.Windows.Forms.MenuItem()
        Me.mnuHelp = New System.Windows.Forms.MenuItem()
        Me.mnuAbout = New System.Windows.Forms.MenuItem()
        Me.mnuTooling = New System.Windows.Forms.MenuItem()
        Me.mnuTooling_Edit = New System.Windows.Forms.MenuItem()
        Me.mnuTooling_Add = New System.Windows.Forms.MenuItem()
        Me.btnFilter = New System.Windows.Forms.Button()
        Me.txtFilter = New System.Windows.Forms.TextBox()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.btnLoad = New System.Windows.Forms.Button()
        Me.grdToolTracker = New System.Windows.Forms.DataGrid()
        CType(Me.grdToolTracker, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'mnuMain
        '
        Me.mnuMain.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuFile, Me.mnuHelp, Me.mnuTooling})
        Me.mnuMain.RightToLeft = CType(resources.GetObject("mnuMain.RightToLeft"), System.Windows.Forms.RightToLeft)
        '
        'mnuFile
        '
        Me.mnuFile.Enabled = CType(resources.GetObject("mnuFile.Enabled"), Boolean)
        Me.mnuFile.Index = 0
        Me.mnuFile.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuPrint, Me.mnuExit})
        Me.mnuFile.Shortcut = CType(resources.GetObject("mnuFile.Shortcut"), System.Windows.Forms.Shortcut)
        Me.mnuFile.ShowShortcut = CType(resources.GetObject("mnuFile.ShowShortcut"), Boolean)
        Me.mnuFile.Text = resources.GetString("mnuFile.Text")
        Me.mnuFile.Visible = CType(resources.GetObject("mnuFile.Visible"), Boolean)
        '
        'mnuPrint
        '
        Me.mnuPrint.Enabled = CType(resources.GetObject("mnuPrint.Enabled"), Boolean)
        Me.mnuPrint.Index = 0
        Me.mnuPrint.Shortcut = CType(resources.GetObject("mnuPrint.Shortcut"), System.Windows.Forms.Shortcut)
        Me.mnuPrint.ShowShortcut = CType(resources.GetObject("mnuPrint.ShowShortcut"), Boolean)
        Me.mnuPrint.Text = resources.GetString("mnuPrint.Text")
        Me.mnuPrint.Visible = CType(resources.GetObject("mnuPrint.Visible"), Boolean)
        '
        'mnuExit
        '
        Me.mnuExit.Enabled = CType(resources.GetObject("mnuExit.Enabled"), Boolean)
        Me.mnuExit.Index = 1
        Me.mnuExit.Shortcut = CType(resources.GetObject("mnuExit.Shortcut"), System.Windows.Forms.Shortcut)
        Me.mnuExit.ShowShortcut = CType(resources.GetObject("mnuExit.ShowShortcut"), Boolean)
        Me.mnuExit.Text = resources.GetString("mnuExit.Text")
        Me.mnuExit.Visible = CType(resources.GetObject("mnuExit.Visible"), Boolean)
        '
        'mnuHelp
        '
        Me.mnuHelp.Enabled = CType(resources.GetObject("mnuHelp.Enabled"), Boolean)
        Me.mnuHelp.Index = 1
        Me.mnuHelp.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuAbout})
        Me.mnuHelp.Shortcut = CType(resources.GetObject("mnuHelp.Shortcut"), System.Windows.Forms.Shortcut)
        Me.mnuHelp.ShowShortcut = CType(resources.GetObject("mnuHelp.ShowShortcut"), Boolean)
        Me.mnuHelp.Text = resources.GetString("mnuHelp.Text")
        Me.mnuHelp.Visible = CType(resources.GetObject("mnuHelp.Visible"), Boolean)
        '
        'mnuAbout
        '
        Me.mnuAbout.Enabled = CType(resources.GetObject("mnuAbout.Enabled"), Boolean)
        Me.mnuAbout.Index = 0
        Me.mnuAbout.Shortcut = CType(resources.GetObject("mnuAbout.Shortcut"), System.Windows.Forms.Shortcut)
        Me.mnuAbout.ShowShortcut = CType(resources.GetObject("mnuAbout.ShowShortcut"), Boolean)
        Me.mnuAbout.Text = resources.GetString("mnuAbout.Text")
        Me.mnuAbout.Visible = CType(resources.GetObject("mnuAbout.Visible"), Boolean)
        '
        'mnuTooling
        '
        Me.mnuTooling.Enabled = CType(resources.GetObject("mnuTooling.Enabled"), Boolean)
        Me.mnuTooling.Index = 2
        Me.mnuTooling.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mnuTooling_Edit, Me.mnuTooling_Add})
        Me.mnuTooling.Shortcut = CType(resources.GetObject("mnuTooling.Shortcut"), System.Windows.Forms.Shortcut)
        Me.mnuTooling.ShowShortcut = CType(resources.GetObject("mnuTooling.ShowShortcut"), Boolean)
        Me.mnuTooling.Text = resources.GetString("mnuTooling.Text")
        Me.mnuTooling.Visible = CType(resources.GetObject("mnuTooling.Visible"), Boolean)
        '
        'mnuTooling_Edit
        '
        Me.mnuTooling_Edit.Enabled = CType(resources.GetObject("mnuTooling_Edit.Enabled"), Boolean)
        Me.mnuTooling_Edit.Index = 0
        Me.mnuTooling_Edit.Shortcut = CType(resources.GetObject("mnuTooling_Edit.Shortcut"), System.Windows.Forms.Shortcut)
        Me.mnuTooling_Edit.ShowShortcut = CType(resources.GetObject("mnuTooling_Edit.ShowShortcut"), Boolean)
        Me.mnuTooling_Edit.Text = resources.GetString("mnuTooling_Edit.Text")
        Me.mnuTooling_Edit.Visible = CType(resources.GetObject("mnuTooling_Edit.Visible"), Boolean)
        '
        'mnuTooling_Add
        '
        Me.mnuTooling_Add.Enabled = CType(resources.GetObject("mnuTooling_Add.Enabled"), Boolean)
        Me.mnuTooling_Add.Index = 1
        Me.mnuTooling_Add.Shortcut = CType(resources.GetObject("mnuTooling_Add.Shortcut"), System.Windows.Forms.Shortcut)
        Me.mnuTooling_Add.ShowShortcut = CType(resources.GetObject("mnuTooling_Add.ShowShortcut"), Boolean)
        Me.mnuTooling_Add.Text = resources.GetString("mnuTooling_Add.Text")
        Me.mnuTooling_Add.Visible = CType(resources.GetObject("mnuTooling_Add.Visible"), Boolean)
        '
        'btnFilter
        '
        Me.btnFilter.AccessibleDescription = CType(resources.GetObject("btnFilter.AccessibleDescription"), String)
        Me.btnFilter.AccessibleName = CType(resources.GetObject("btnFilter.AccessibleName"), String)
        Me.btnFilter.Anchor = CType(resources.GetObject("btnFilter.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.btnFilter.BackgroundImage = CType(resources.GetObject("btnFilter.BackgroundImage"), System.Drawing.Image)
        Me.btnFilter.Dock = CType(resources.GetObject("btnFilter.Dock"), System.Windows.Forms.DockStyle)
        Me.btnFilter.Enabled = CType(resources.GetObject("btnFilter.Enabled"), Boolean)
        Me.btnFilter.FlatStyle = CType(resources.GetObject("btnFilter.FlatStyle"), System.Windows.Forms.FlatStyle)
        Me.btnFilter.Font = CType(resources.GetObject("btnFilter.Font"), System.Drawing.Font)
        Me.btnFilter.Image = CType(resources.GetObject("btnFilter.Image"), System.Drawing.Image)
        Me.btnFilter.ImageAlign = CType(resources.GetObject("btnFilter.ImageAlign"), System.Drawing.ContentAlignment)
        Me.btnFilter.ImageIndex = CType(resources.GetObject("btnFilter.ImageIndex"), Integer)
        Me.btnFilter.ImeMode = CType(resources.GetObject("btnFilter.ImeMode"), System.Windows.Forms.ImeMode)
        Me.btnFilter.Location = CType(resources.GetObject("btnFilter.Location"), System.Drawing.Point)
        Me.btnFilter.Name = "btnFilter"
        Me.btnFilter.RightToLeft = CType(resources.GetObject("btnFilter.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.btnFilter.Size = CType(resources.GetObject("btnFilter.Size"), System.Drawing.Size)
        Me.btnFilter.TabIndex = CType(resources.GetObject("btnFilter.TabIndex"), Integer)
        Me.btnFilter.Text = resources.GetString("btnFilter.Text")
        Me.btnFilter.TextAlign = CType(resources.GetObject("btnFilter.TextAlign"), System.Drawing.ContentAlignment)
        Me.btnFilter.Visible = CType(resources.GetObject("btnFilter.Visible"), Boolean)
        '
        'txtFilter
        '
        Me.txtFilter.AccessibleDescription = CType(resources.GetObject("txtFilter.AccessibleDescription"), String)
        Me.txtFilter.AccessibleName = CType(resources.GetObject("txtFilter.AccessibleName"), String)
        Me.txtFilter.Anchor = CType(resources.GetObject("txtFilter.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.txtFilter.AutoSize = CType(resources.GetObject("txtFilter.AutoSize"), Boolean)
        Me.txtFilter.BackgroundImage = CType(resources.GetObject("txtFilter.BackgroundImage"), System.Drawing.Image)
        Me.txtFilter.Dock = CType(resources.GetObject("txtFilter.Dock"), System.Windows.Forms.DockStyle)
        Me.txtFilter.Enabled = CType(resources.GetObject("txtFilter.Enabled"), Boolean)
        Me.txtFilter.Font = CType(resources.GetObject("txtFilter.Font"), System.Drawing.Font)
        Me.txtFilter.ImeMode = CType(resources.GetObject("txtFilter.ImeMode"), System.Windows.Forms.ImeMode)
        Me.txtFilter.Location = CType(resources.GetObject("txtFilter.Location"), System.Drawing.Point)
        Me.txtFilter.MaxLength = CType(resources.GetObject("txtFilter.MaxLength"), Integer)
        Me.txtFilter.Multiline = CType(resources.GetObject("txtFilter.Multiline"), Boolean)
        Me.txtFilter.Name = "txtFilter"
        Me.txtFilter.PasswordChar = CType(resources.GetObject("txtFilter.PasswordChar"), Char)
        Me.txtFilter.RightToLeft = CType(resources.GetObject("txtFilter.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.txtFilter.ScrollBars = CType(resources.GetObject("txtFilter.ScrollBars"), System.Windows.Forms.ScrollBars)
        Me.txtFilter.Size = CType(resources.GetObject("txtFilter.Size"), System.Drawing.Size)
        Me.txtFilter.TabIndex = CType(resources.GetObject("txtFilter.TabIndex"), Integer)
        Me.txtFilter.Text = resources.GetString("txtFilter.Text")
        Me.txtFilter.TextAlign = CType(resources.GetObject("txtFilter.TextAlign"), System.Windows.Forms.HorizontalAlignment)
        Me.txtFilter.Visible = CType(resources.GetObject("txtFilter.Visible"), Boolean)
        Me.txtFilter.WordWrap = CType(resources.GetObject("txtFilter.WordWrap"), Boolean)
        '
        'Label1
        '
        Me.Label1.AccessibleDescription = CType(resources.GetObject("Label1.AccessibleDescription"), String)
        Me.Label1.AccessibleName = CType(resources.GetObject("Label1.AccessibleName"), String)
        Me.Label1.Anchor = CType(resources.GetObject("Label1.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.Label1.AutoSize = CType(resources.GetObject("Label1.AutoSize"), Boolean)
        Me.Label1.Dock = CType(resources.GetObject("Label1.Dock"), System.Windows.Forms.DockStyle)
        Me.Label1.Enabled = CType(resources.GetObject("Label1.Enabled"), Boolean)
        Me.Label1.Font = CType(resources.GetObject("Label1.Font"), System.Drawing.Font)
        Me.Label1.Image = CType(resources.GetObject("Label1.Image"), System.Drawing.Image)
        Me.Label1.ImageAlign = CType(resources.GetObject("Label1.ImageAlign"), System.Drawing.ContentAlignment)
        Me.Label1.ImageIndex = CType(resources.GetObject("Label1.ImageIndex"), Integer)
        Me.Label1.ImeMode = CType(resources.GetObject("Label1.ImeMode"), System.Windows.Forms.ImeMode)
        Me.Label1.Location = CType(resources.GetObject("Label1.Location"), System.Drawing.Point)
        Me.Label1.Name = "Label1"
        Me.Label1.RightToLeft = CType(resources.GetObject("Label1.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.Label1.Size = CType(resources.GetObject("Label1.Size"), System.Drawing.Size)
        Me.Label1.TabIndex = CType(resources.GetObject("Label1.TabIndex"), Integer)
        Me.Label1.Text = resources.GetString("Label1.Text")
        Me.Label1.TextAlign = CType(resources.GetObject("Label1.TextAlign"), System.Drawing.ContentAlignment)
        Me.Label1.Visible = CType(resources.GetObject("Label1.Visible"), Boolean)
        '
        'btnLoad
        '
        Me.btnLoad.AccessibleDescription = CType(resources.GetObject("btnLoad.AccessibleDescription"), String)
        Me.btnLoad.AccessibleName = CType(resources.GetObject("btnLoad.AccessibleName"), String)
        Me.btnLoad.Anchor = CType(resources.GetObject("btnLoad.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.btnLoad.BackgroundImage = CType(resources.GetObject("btnLoad.BackgroundImage"), System.Drawing.Image)
        Me.btnLoad.Dock = CType(resources.GetObject("btnLoad.Dock"), System.Windows.Forms.DockStyle)
        Me.btnLoad.Enabled = CType(resources.GetObject("btnLoad.Enabled"), Boolean)
        Me.btnLoad.FlatStyle = CType(resources.GetObject("btnLoad.FlatStyle"), System.Windows.Forms.FlatStyle)
        Me.btnLoad.Font = CType(resources.GetObject("btnLoad.Font"), System.Drawing.Font)
        Me.btnLoad.Image = CType(resources.GetObject("btnLoad.Image"), System.Drawing.Image)
        Me.btnLoad.ImageAlign = CType(resources.GetObject("btnLoad.ImageAlign"), System.Drawing.ContentAlignment)
        Me.btnLoad.ImageIndex = CType(resources.GetObject("btnLoad.ImageIndex"), Integer)
        Me.btnLoad.ImeMode = CType(resources.GetObject("btnLoad.ImeMode"), System.Windows.Forms.ImeMode)
        Me.btnLoad.Location = CType(resources.GetObject("btnLoad.Location"), System.Drawing.Point)
        Me.btnLoad.Name = "btnLoad"
        Me.btnLoad.RightToLeft = CType(resources.GetObject("btnLoad.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.btnLoad.Size = CType(resources.GetObject("btnLoad.Size"), System.Drawing.Size)
        Me.btnLoad.TabIndex = CType(resources.GetObject("btnLoad.TabIndex"), Integer)
        Me.btnLoad.Text = resources.GetString("btnLoad.Text")
        Me.btnLoad.TextAlign = CType(resources.GetObject("btnLoad.TextAlign"), System.Drawing.ContentAlignment)
        Me.btnLoad.Visible = CType(resources.GetObject("btnLoad.Visible"), Boolean)
        '
        'grdToolTracker
        '
        Me.grdToolTracker.AccessibleDescription = CType(resources.GetObject("grdToolTracker.AccessibleDescription"), String)
        Me.grdToolTracker.AccessibleName = CType(resources.GetObject("grdToolTracker.AccessibleName"), String)
        Me.grdToolTracker.Anchor = CType(resources.GetObject("grdToolTracker.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.grdToolTracker.BackgroundImage = CType(resources.GetObject("grdToolTracker.BackgroundImage"), System.Drawing.Image)
        Me.grdToolTracker.CaptionFont = CType(resources.GetObject("grdToolTracker.CaptionFont"), System.Drawing.Font)
        Me.grdToolTracker.CaptionText = resources.GetString("grdToolTracker.CaptionText")
        Me.grdToolTracker.DataMember = ""
        Me.grdToolTracker.Dock = CType(resources.GetObject("grdToolTracker.Dock"), System.Windows.Forms.DockStyle)
        Me.grdToolTracker.Enabled = CType(resources.GetObject("grdToolTracker.Enabled"), Boolean)
        Me.grdToolTracker.Font = CType(resources.GetObject("grdToolTracker.Font"), System.Drawing.Font)
        Me.grdToolTracker.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.grdToolTracker.ImeMode = CType(resources.GetObject("grdToolTracker.ImeMode"), System.Windows.Forms.ImeMode)
        Me.grdToolTracker.Location = CType(resources.GetObject("grdToolTracker.Location"), System.Drawing.Point)
        Me.grdToolTracker.Name = "grdToolTracker"
        Me.grdToolTracker.ReadOnly = True
        Me.grdToolTracker.RightToLeft = CType(resources.GetObject("grdToolTracker.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.grdToolTracker.Size = CType(resources.GetObject("grdToolTracker.Size"), System.Drawing.Size)
        Me.grdToolTracker.TabIndex = CType(resources.GetObject("grdToolTracker.TabIndex"), Integer)
        Me.grdToolTracker.Visible = CType(resources.GetObject("grdToolTracker.Visible"), Boolean)
        '
        'frmToolTracker_DataGrid
        '
        Me.AccessibleDescription = CType(resources.GetObject("$this.AccessibleDescription"), String)
        Me.AccessibleName = CType(resources.GetObject("$this.AccessibleName"), String)
        Me.Anchor = CType(resources.GetObject("$this.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.AutoScaleBaseSize = CType(resources.GetObject("$this.AutoScaleBaseSize"), System.Drawing.Size)
        Me.AutoScroll = CType(resources.GetObject("$this.AutoScroll"), Boolean)
        Me.AutoScrollMargin = CType(resources.GetObject("$this.AutoScrollMargin"), System.Drawing.Size)
        Me.AutoScrollMinSize = CType(resources.GetObject("$this.AutoScrollMinSize"), System.Drawing.Size)
        Me.BackgroundImage = CType(resources.GetObject("$this.BackgroundImage"), System.Drawing.Image)
        Me.ClientSize = CType(resources.GetObject("$this.ClientSize"), System.Drawing.Size)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnFilter, Me.txtFilter, Me.Label1, Me.btnLoad, Me.grdToolTracker})
        Me.Dock = CType(resources.GetObject("$this.Dock"), System.Windows.Forms.DockStyle)
        Me.Enabled = CType(resources.GetObject("$this.Enabled"), Boolean)
        Me.Font = CType(resources.GetObject("$this.Font"), System.Drawing.Font)
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.ImeMode = CType(resources.GetObject("$this.ImeMode"), System.Windows.Forms.ImeMode)
        Me.Location = CType(resources.GetObject("$this.Location"), System.Drawing.Point)
        Me.MaximumSize = CType(resources.GetObject("$this.MaximumSize"), System.Drawing.Size)
        Me.Menu = Me.mnuMain
        Me.MinimumSize = CType(resources.GetObject("$this.MinimumSize"), System.Drawing.Size)
        Me.Name = "frmToolTracker_DataGrid"
        Me.RightToLeft = CType(resources.GetObject("$this.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.StartPosition = CType(resources.GetObject("$this.StartPosition"), System.Windows.Forms.FormStartPosition)
        Me.Text = resources.GetString("$this.Text")
        Me.Visible = CType(resources.GetObject("$this.Visible"), Boolean)
        Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
        CType(Me.grdToolTracker, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

#End Region

#Region " Standard Menu Code "
    ' <System.Diagnostics.DebuggerStepThrough()> has been added to some procedures since they are
    ' not the focus of the demo. Remove them if you wish to debug the procedures.
    ' This code simply shows the About form.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub mnuAbout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuAbout.Click
        ' Open the About form in Dialog Mode
        Dim frm As New frmAbout()
        frm.ShowDialog(Me)
        frm.Dispose()
    End Sub


    <System.Diagnostics.DebuggerStepThrough()> Private Sub mnuPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuPrint.Click
        ' Open the Crystal Report form in Dialog Mode
        Dim frmCrystal As New frmToolTracker_Crystal()
        frmCrystal.ShowDialog(Me)
        frmCrystal.Dispose()
    End Sub

    <System.Diagnostics.DebuggerStepThrough()> Private Sub mnuTooling_Add_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuTooling_Add.Click
        ' Open the Add Tooling Form
        Dim frmToolTracker_AddTool As New frmToolTracker_AddTool()
        frmToolTracker_AddTool.ShowDialog(Me)
        frmToolTracker_AddTool.Dispose()
    End Sub

    <System.Diagnostics.DebuggerStepThrough()> Private Sub mnuTooling_Edit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuTooling_Edit.Click
        ' Open the Edit Tooling Form
        Dim frmToolTracker_EditTool As New frmToolTracker_EditTool()
        frmToolTracker_EditTool.ShowDialog(Me)
        frmToolTracker_EditTool.Dispose()
    End Sub



    ' This code will close the form.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub mnuExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuExit.Click
        ' Close the current form
        Me.Close()
    End Sub
#End Region

    Private Sub btnFilter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFilter.Click
        Const MESSAGEBOX_CAPTION As String = "Filter"

        ' Sanity check
        Debug.Assert(Not ProductData.Tables(PRODUCT_TABLE_NAME) Is Nothing, _
            "No product data loaded in ProductData.Tables(PRODUCT_TABLE_NAME)")

        With ProductData.Tables(PRODUCT_TABLE_NAME)
            ' Filter the view so that only product names starting with a
            ' specified string are available.
            .DefaultView.RowFilter = "Tool like '" & txtFilter.Text & "%'"

            ' Are there any matching products?
            If .DefaultView.Count = 0 Then
                MessageBox.Show("No matching rows.", _
                    MESSAGEBOX_CAPTION, _
                    MessageBoxButtons.OK, _
                    MessageBoxIcon.Information)
            End If

            ' By binding the grid to the DataView, the grid will now display
            ' only the matching rows.
            grdToolTracker.DataSource = .DefaultView
        End With
    End Sub

    Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoad.Click

        Dim frmStatusMessage As New frmStatus()
        If Not didPreviouslyConnect Then
            frmStatusMessage.Show("Connecting to SQL Server")
        End If

        Dim isConnecting As Boolean = True
        While isConnecting
            Try


                Dim northwindConnection As New SqlConnection(connectionString)

                ' The SqlDataAdapter is used to move data between SQL Server,
                ' and a DataSet.
                Dim ProductAdapter As New SqlDataAdapter( _
                    "select * from TL_Tooling", _
                    northwindConnection)

                ' Clear out any old data that has been previously loaded into
                ' the DataSet
                ProductData.Clear()

                ' Populate the DataSet with the information from the products
                ' table.  Since a DataSet can hold multiple result sets, it's
                ' a good idea to "name" the result set when you populate the
                ' DataSet.  In this case, the result set is named "Products".
                ProductAdapter.Fill(ProductData, PRODUCT_TABLE_NAME)

                ' Bind the DataGrid to the desired table in the DataSet. This
                ' will cause the product information to display.
                grdToolTracker.DataSource = ProductData.Tables(PRODUCT_TABLE_NAME)

                '//////////Hide columns in SQL that don't want user to see
                Dim TS As New DataGridTableStyle()
                TS.MappingName = PRODUCT_TABLE_NAME

                Dim Col As New DataGridTextBoxColumn()
                Col.MappingName = "ID"
                Col.HeaderText = "ID"
                Col.Width = 100
                TS.GridColumnStyles.Add(Col)

                'Repaet these set of lines for all columns we want to see
                Col = New DataGridTextBoxColumn()
                Col.MappingName = "ToolID"
                Col.HeaderText = "ToolID"
                Col.Width = 100
                TS.GridColumnStyles.Add(Col)

                Col = New DataGridTextBoxColumn()
                Col.MappingName = "ToolNumber"
                Col.HeaderText = "ToolNumber"
                Col.Width = 100
                TS.GridColumnStyles.Add(Col)

                Col = New DataGridTextBoxColumn()
                Col.MappingName = "Description"
                Col.HeaderText = "Description"
                Col.Width = 100
                TS.GridColumnStyles.Add(Col)

                Col = New DataGridTextBoxColumn()
                Col.MappingName = "SerialNumber"
                Col.HeaderText = "SerialNumber"
                Col.Width = 100
                TS.GridColumnStyles.Add(Col)

                Col = New DataGridTextBoxColumn()
                Col.MappingName = "Location"
                Col.HeaderText = "Location"
                Col.Width = 100
                TS.GridColumnStyles.Add(Col)

                Col = New DataGridTextBoxColumn()
                Col.MappingName = "StatusCode"
                Col.HeaderText = "StatusCode"
                Col.Width = 150
                TS.GridColumnStyles.Add(Col)

                'Col = New DataGridTextBoxColumn()
                'Col.MappingName = "SALARY"
                'Col.Width = 0
                'TS.GridColumnStyles.Add(Col)


                grdToolTracker.TableStyles.Add(TS)


                '//////////End Hide Columns


                ' Now that the grid is populated, let the user filter the results.
                btnFilter.Enabled = True
                isConnecting = False

            Catch exc As Exception
                If connectionString = SQL_CONNECTION_STRING Then
                    ' Couldn't connect to SQL Server.  Kill The Connection.

                    frmStatusMessage.Show("Connection Dead, Killing Tool Tracker")

                    End
                End If
            End Try
        End While

        frmStatusMessage.Close()
    End Sub



End Class
1) Declare a public function with parameters in your form2.

2) When you double click on the row of record in the datagrid of your form1, you will need to call
    form2 out. but before you call the form2 out, call out the public function with parameters from
    form2 first and pass in whatever values you need from your form1. This way you will be able to
    transfer your selected data from your form1s' datagrid to form2.  
I have tried that before even posting on here with no success.  Would you happen to have an example of how the code is laid out.
On the Double Click Event of the DataGrid write

        Dim DR As DataRow
        DR = DataTable1.Rows(DataGrid.CurrentRowIndex)
        Dim Frm as New YourForm
        Frm.ShowData(DR)
        Frm.Show


Now Your Form which Shows the Data will have a function called ShowData

   Public Sub Showdata(ByVal Dr As DataRow)
        TextBox1.Text = Dr(0)
        TextBox2.Text = Dr(1)
    End Sub


However this is not a very preferred method of doing things, For example Double Click event will be fired even if the user double clicks on an empty region of the Grid,
Why don't you allow the user to Edit the Data in place, in the Grid itself...

arif_eqbal,

I could not agree with you more, on possibly letting the users edit the grid on the grid itself, however, for this application, this is totally out of the question.  When the user double clicks the grid, it fires off that "form" I was talking about, which in return contains a relationship recordset to make even more calls to SQL.  When I get this project done, I could let you download the source, and I will make it available on EE for others to see.

Anyhow, its fine even if the cell is empty, as long as when they doubleclick the grid it sends the details to the form pertaining to the row clicked.  Actually, in some cases, some of the values may be null to begin with, so this should work just fine.  I am going to try your method, and get back with you.

Thanks again, I will be in touch.
DataTable1 is not Delared

Frm.ShowData is not a member of "PROJECTNAME"
Well DataTable1 was just a dummy name I used
You need to replace it with the DataTable Used by you.

Also ShowData function that I have written must be put on the Form where you need to show the data...

'Rows' is not a member of 'System.Windows.Forms.DataGrid'.

=============CODE=============

    Private Sub grdToolTracker_Navigate(ByVal sender As System.Object, ByVal ne As System.Windows.Forms.NavigateEventArgs) Handles grdToolTracker.Navigate
        Dim DR As DataRow
        DR = grdToolTracker.Rows(DataGrid.CurrentRowIndex)
        Dim Frm As New frmToolTracker_EditTool()
        Frm.Showdata(DR)
        Frm.Show()
    End Sub

=========END CODE=============

Option Strict On disallows implicit conversions from 'System.Object' to 'String'.  

The above error is in reference to "Dr(0)"

=============CODE=============

    Public Sub Showdata(ByVal Dr As DataRow)
        txtToolID.Text = Dr(0)
        txtToolNumber.Text = Dr(1)
    End Sub

==============================

on the option strict, that was my mistake.  I forgot to put  Option Strict Off in the code
Your datagrid should be bound to a typed dataset.

Create the popup as a new form bound to the same typed dataset.

In the original form include an event handler for the grid's mouse down event:

    Private Sub DataGrid1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DataGrid1.MouseDown
        If e.Clicks = 2 AndAlso Me.DataGrid1.HitTest(e.X, e.Y).Row > -1 Then 'Double clicked the row selector
            Dim popup As New Form2
            popup.Dataset11.Merge(Me.Dataset11)
            popup.BindingContext.Item(popup.Dataset11, "table1").Position = Me.DataGrid1.HitTest(e.X, e.Y).Row
            popup.ShowDialog()
            Me.Dataset11.Clear()
            Me.Dataset11.Merge(popup.Dataset11)
        End If
    End Sub
when you say original form, you are refering to the actual datagrid form page correct?
Gotcha.  I have already spend a lot of time coding the form I want to open, with the doubleclick event.  It is called frmToolTracker_EditTool

Is there a way I can confirm it is bound, or if it is not, to do this.  I am very new to .NET
Here is the form I want to open when that datagrid is doubleclicked






Option Strict Off
Imports System.Data.SqlClient

Public Class frmToolTracker_EditTool
    Inherits System.Windows.Forms.Form

    Protected ToolingData As New DataSet()


    Protected Const SQL_CONNECTION_STRING As String = _
        "Server=localhost;" & _
        "DataBase=Triumph;" & _
        "Integrated Security=SSPI"


    Protected didPreviouslyConnect As Boolean = False
    Protected connectionString As String = SQL_CONNECTION_STRING

    ' Used to reference the table containing product information in
    ' ProductData.
    Protected Const TOOLING_TABLE_NAME As String = "TL_Events"


#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 btnClose As System.Windows.Forms.Button
    Friend WithEvents btnSave As System.Windows.Forms.Button
    Friend WithEvents txtCT3 As System.Windows.Forms.TextBox
    Friend WithEvents txtCT2 As System.Windows.Forms.TextBox
    Friend WithEvents txtCT1 As System.Windows.Forms.TextBox
    Friend WithEvents txtToolValue As System.Windows.Forms.TextBox
    Friend WithEvents txtTolerance As System.Windows.Forms.TextBox
    Friend WithEvents txtCalibrationFreq As System.Windows.Forms.TextBox
    Friend WithEvents txtEntryDate As System.Windows.Forms.TextBox
    Friend WithEvents txtEntryPerson As System.Windows.Forms.TextBox
    Friend WithEvents cmbStatus As System.Windows.Forms.ComboBox
    Friend WithEvents lblToolValue As System.Windows.Forms.Label
    Friend WithEvents lblTolerance As System.Windows.Forms.Label
    Friend WithEvents lblCalibrationTarget As System.Windows.Forms.Label
    Friend WithEvents lblCalibrationFreq As System.Windows.Forms.Label
    Friend WithEvents lblEntryDate As System.Windows.Forms.Label
    Friend WithEvents lblEntryPerson As System.Windows.Forms.Label
    Friend WithEvents lblStatus As System.Windows.Forms.Label
    Friend WithEvents txtPieces As System.Windows.Forms.TextBox
    Friend WithEvents txtToolOwner As System.Windows.Forms.TextBox
    Friend WithEvents txtLocation As System.Windows.Forms.TextBox
    Friend WithEvents txtDescription As System.Windows.Forms.TextBox
    Friend WithEvents txtSerialNumber As System.Windows.Forms.TextBox
    Friend WithEvents txtToolNumber As System.Windows.Forms.TextBox
    Friend WithEvents txtToolID As System.Windows.Forms.TextBox
    Friend WithEvents lblPieces As System.Windows.Forms.Label
    Friend WithEvents lblToolOwner As System.Windows.Forms.Label
    Friend WithEvents lblSameCust As System.Windows.Forms.Label
    Friend WithEvents lblCustomer As System.Windows.Forms.Label
    Friend WithEvents lblLocation As System.Windows.Forms.Label
    Friend WithEvents lblDescription As System.Windows.Forms.Label
    Friend WithEvents lblSerialNumber As System.Windows.Forms.Label
    Friend WithEvents lblToolNumber As System.Windows.Forms.Label
    Friend WithEvents lblToolID As System.Windows.Forms.Label
    Friend WithEvents grpboxComments As System.Windows.Forms.GroupBox
    Friend WithEvents btnAddEvent As System.Windows.Forms.Button
    Friend WithEvents btnRedTag As System.Windows.Forms.Button
    Friend WithEvents rtbComments As System.Windows.Forms.RichTextBox
    Friend WithEvents grdEvent As System.Windows.Forms.DataGrid
    Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
    Friend WithEvents btnLoad As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmToolTracker_EditTool))
        Me.btnClose = New System.Windows.Forms.Button()
        Me.btnSave = New System.Windows.Forms.Button()
        Me.txtCT3 = New System.Windows.Forms.TextBox()
        Me.txtCT2 = New System.Windows.Forms.TextBox()
        Me.txtCT1 = New System.Windows.Forms.TextBox()
        Me.txtToolValue = New System.Windows.Forms.TextBox()
        Me.txtTolerance = New System.Windows.Forms.TextBox()
        Me.txtCalibrationFreq = New System.Windows.Forms.TextBox()
        Me.txtEntryDate = New System.Windows.Forms.TextBox()
        Me.txtEntryPerson = New System.Windows.Forms.TextBox()
        Me.cmbStatus = New System.Windows.Forms.ComboBox()
        Me.lblToolValue = New System.Windows.Forms.Label()
        Me.lblTolerance = New System.Windows.Forms.Label()
        Me.lblCalibrationTarget = New System.Windows.Forms.Label()
        Me.lblCalibrationFreq = New System.Windows.Forms.Label()
        Me.lblEntryDate = New System.Windows.Forms.Label()
        Me.lblEntryPerson = New System.Windows.Forms.Label()
        Me.lblStatus = New System.Windows.Forms.Label()
        Me.txtPieces = New System.Windows.Forms.TextBox()
        Me.txtToolOwner = New System.Windows.Forms.TextBox()
        Me.txtLocation = New System.Windows.Forms.TextBox()
        Me.txtDescription = New System.Windows.Forms.TextBox()
        Me.txtSerialNumber = New System.Windows.Forms.TextBox()
        Me.txtToolNumber = New System.Windows.Forms.TextBox()
        Me.txtToolID = New System.Windows.Forms.TextBox()
        Me.lblPieces = New System.Windows.Forms.Label()
        Me.lblToolOwner = New System.Windows.Forms.Label()
        Me.lblSameCust = New System.Windows.Forms.Label()
        Me.lblCustomer = New System.Windows.Forms.Label()
        Me.lblLocation = New System.Windows.Forms.Label()
        Me.lblDescription = New System.Windows.Forms.Label()
        Me.lblSerialNumber = New System.Windows.Forms.Label()
        Me.lblToolNumber = New System.Windows.Forms.Label()
        Me.lblToolID = New System.Windows.Forms.Label()
        Me.grdEvent = New System.Windows.Forms.DataGrid()
        Me.grpboxComments = New System.Windows.Forms.GroupBox()
        Me.rtbComments = New System.Windows.Forms.RichTextBox()
        Me.btnAddEvent = New System.Windows.Forms.Button()
        Me.btnRedTag = New System.Windows.Forms.Button()
        Me.GroupBox1 = New System.Windows.Forms.GroupBox()
        Me.btnLoad = New System.Windows.Forms.Button()
        CType(Me.grdEvent, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.grpboxComments.SuspendLayout()
        Me.GroupBox1.SuspendLayout()
        Me.SuspendLayout()
        '
        'btnClose
        '
        Me.btnClose.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.btnClose.Location = New System.Drawing.Point(192, 512)
        Me.btnClose.Name = "btnClose"
        Me.btnClose.TabIndex = 71
        Me.btnClose.Text = "&Close"
        '
        'btnSave
        '
        Me.btnSave.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.btnSave.Location = New System.Drawing.Point(88, 512)
        Me.btnSave.Name = "btnSave"
        Me.btnSave.TabIndex = 70
        Me.btnSave.Text = "&Save"
        '
        'txtCT3
        '
        Me.txtCT3.Location = New System.Drawing.Point(632, 123)
        Me.txtCT3.Name = "txtCT3"
        Me.txtCT3.Size = New System.Drawing.Size(44, 20)
        Me.txtCT3.TabIndex = 67
        Me.txtCT3.Text = ""
        '
        'txtCT2
        '
        Me.txtCT2.Location = New System.Drawing.Point(576, 123)
        Me.txtCT2.Name = "txtCT2"
        Me.txtCT2.Size = New System.Drawing.Size(44, 20)
        Me.txtCT2.TabIndex = 66
        Me.txtCT2.Text = ""
        '
        'txtCT1
        '
        Me.txtCT1.Location = New System.Drawing.Point(520, 123)
        Me.txtCT1.Name = "txtCT1"
        Me.txtCT1.Size = New System.Drawing.Size(44, 20)
        Me.txtCT1.TabIndex = 65
        Me.txtCT1.Text = ""
        '
        'txtToolValue
        '
        Me.txtToolValue.Location = New System.Drawing.Point(520, 171)
        Me.txtToolValue.Name = "txtToolValue"
        Me.txtToolValue.Size = New System.Drawing.Size(144, 20)
        Me.txtToolValue.TabIndex = 64
        Me.txtToolValue.Text = ""
        '
        'txtTolerance
        '
        Me.txtTolerance.Location = New System.Drawing.Point(520, 147)
        Me.txtTolerance.Name = "txtTolerance"
        Me.txtTolerance.Size = New System.Drawing.Size(144, 20)
        Me.txtTolerance.TabIndex = 63
        Me.txtTolerance.Text = ""
        '
        'txtCalibrationFreq
        '
        Me.txtCalibrationFreq.Location = New System.Drawing.Point(520, 99)
        Me.txtCalibrationFreq.Name = "txtCalibrationFreq"
        Me.txtCalibrationFreq.Size = New System.Drawing.Size(88, 20)
        Me.txtCalibrationFreq.TabIndex = 62
        Me.txtCalibrationFreq.Text = ""
        '
        'txtEntryDate
        '
        Me.txtEntryDate.Location = New System.Drawing.Point(520, 75)
        Me.txtEntryDate.Name = "txtEntryDate"
        Me.txtEntryDate.Size = New System.Drawing.Size(144, 20)
        Me.txtEntryDate.TabIndex = 61
        Me.txtEntryDate.Text = ""
        '
        'txtEntryPerson
        '
        Me.txtEntryPerson.Location = New System.Drawing.Point(520, 51)
        Me.txtEntryPerson.Name = "txtEntryPerson"
        Me.txtEntryPerson.Size = New System.Drawing.Size(144, 20)
        Me.txtEntryPerson.TabIndex = 60
        Me.txtEntryPerson.Text = ""
        '
        'cmbStatus
        '
        Me.cmbStatus.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.cmbStatus.Items.AddRange(New Object() {"INHOUSE", "ENGINEER"})
        Me.cmbStatus.Location = New System.Drawing.Point(520, 27)
        Me.cmbStatus.Name = "cmbStatus"
        Me.cmbStatus.Size = New System.Drawing.Size(176, 21)
        Me.cmbStatus.TabIndex = 59
        '
        'lblToolValue
        '
        Me.lblToolValue.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblToolValue.Location = New System.Drawing.Point(392, 171)
        Me.lblToolValue.Name = "lblToolValue"
        Me.lblToolValue.Size = New System.Drawing.Size(120, 16)
        Me.lblToolValue.TabIndex = 58
        Me.lblToolValue.Text = "Tool Value:"
        Me.lblToolValue.TextAlign = System.Drawing.ContentAlignment.TopRight
        '
        'lblTolerance
        '
        Me.lblTolerance.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblTolerance.Location = New System.Drawing.Point(392, 147)
        Me.lblTolerance.Name = "lblTolerance"
        Me.lblTolerance.Size = New System.Drawing.Size(120, 16)
        Me.lblTolerance.TabIndex = 57
        Me.lblTolerance.Text = "Tolerance:"
        Me.lblTolerance.TextAlign = System.Drawing.ContentAlignment.TopRight
        '
        'lblCalibrationTarget
        '
        Me.lblCalibrationTarget.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblCalibrationTarget.Location = New System.Drawing.Point(392, 123)
        Me.lblCalibrationTarget.Name = "lblCalibrationTarget"
        Me.lblCalibrationTarget.Size = New System.Drawing.Size(120, 16)
        Me.lblCalibrationTarget.TabIndex = 56
        Me.lblCalibrationTarget.Text = "Calibration Target:"
        Me.lblCalibrationTarget.TextAlign = System.Drawing.ContentAlignment.TopRight
        '
        'lblCalibrationFreq
        '
        Me.lblCalibrationFreq.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblCalibrationFreq.Location = New System.Drawing.Point(392, 99)
        Me.lblCalibrationFreq.Name = "lblCalibrationFreq"
        Me.lblCalibrationFreq.Size = New System.Drawing.Size(120, 16)
        Me.lblCalibrationFreq.TabIndex = 55
        Me.lblCalibrationFreq.Text = "Calibration Freq:"
        Me.lblCalibrationFreq.TextAlign = System.Drawing.ContentAlignment.TopRight
        '
        'lblEntryDate
        '
        Me.lblEntryDate.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblEntryDate.Location = New System.Drawing.Point(392, 75)
        Me.lblEntryDate.Name = "lblEntryDate"
        Me.lblEntryDate.Size = New System.Drawing.Size(120, 16)
        Me.lblEntryDate.TabIndex = 54
        Me.lblEntryDate.Text = "Entry Date:"
        Me.lblEntryDate.TextAlign = System.Drawing.ContentAlignment.TopRight
        '
        'lblEntryPerson
        '
        Me.lblEntryPerson.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblEntryPerson.Location = New System.Drawing.Point(392, 51)
        Me.lblEntryPerson.Name = "lblEntryPerson"
        Me.lblEntryPerson.Size = New System.Drawing.Size(120, 16)
        Me.lblEntryPerson.TabIndex = 53
        Me.lblEntryPerson.Text = "Entry Person:"
        Me.lblEntryPerson.TextAlign = System.Drawing.ContentAlignment.TopRight
        '
        'lblStatus
        '
        Me.lblStatus.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblStatus.Location = New System.Drawing.Point(392, 27)
        Me.lblStatus.Name = "lblStatus"
        Me.lblStatus.Size = New System.Drawing.Size(120, 16)
        Me.lblStatus.TabIndex = 52
        Me.lblStatus.Text = "Status:"
        Me.lblStatus.TextAlign = System.Drawing.ContentAlignment.TopRight
        '
        'txtPieces
        '
        Me.txtPieces.Location = New System.Drawing.Point(136, 219)
        Me.txtPieces.Name = "txtPieces"
        Me.txtPieces.Size = New System.Drawing.Size(48, 20)
        Me.txtPieces.TabIndex = 51
        Me.txtPieces.Text = ""
        '
        'txtToolOwner
        '
        Me.txtToolOwner.Location = New System.Drawing.Point(136, 195)
        Me.txtToolOwner.Name = "txtToolOwner"
        Me.txtToolOwner.Size = New System.Drawing.Size(168, 20)
        Me.txtToolOwner.TabIndex = 50
        Me.txtToolOwner.Text = ""
        '
        'txtLocation
        '
        Me.txtLocation.Location = New System.Drawing.Point(136, 123)
        Me.txtLocation.Name = "txtLocation"
        Me.txtLocation.Size = New System.Drawing.Size(168, 20)
        Me.txtLocation.TabIndex = 49
        Me.txtLocation.Text = ""
        '
        'txtDescription
        '
        Me.txtDescription.Location = New System.Drawing.Point(136, 99)
        Me.txtDescription.Name = "txtDescription"
        Me.txtDescription.Size = New System.Drawing.Size(168, 20)
        Me.txtDescription.TabIndex = 48
        Me.txtDescription.Text = ""
        '
        'txtSerialNumber
        '
        Me.txtSerialNumber.Location = New System.Drawing.Point(136, 75)
        Me.txtSerialNumber.Name = "txtSerialNumber"
        Me.txtSerialNumber.Size = New System.Drawing.Size(168, 20)
        Me.txtSerialNumber.TabIndex = 47
        Me.txtSerialNumber.Text = ""
        '
        'txtToolNumber
        '
        Me.txtToolNumber.Location = New System.Drawing.Point(136, 51)
        Me.txtToolNumber.Name = "txtToolNumber"
        Me.txtToolNumber.Size = New System.Drawing.Size(168, 20)
        Me.txtToolNumber.TabIndex = 46
        Me.txtToolNumber.Text = ""
        '
        'txtToolID
        '
        Me.txtToolID.Location = New System.Drawing.Point(136, 27)
        Me.txtToolID.Name = "txtToolID"
        Me.txtToolID.Size = New System.Drawing.Size(168, 20)
        Me.txtToolID.TabIndex = 45
        Me.txtToolID.Text = ""
        '
        'lblPieces
        '
        Me.lblPieces.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblPieces.Location = New System.Drawing.Point(8, 219)
        Me.lblPieces.Name = "lblPieces"
        Me.lblPieces.Size = New System.Drawing.Size(120, 16)
        Me.lblPieces.TabIndex = 44
        Me.lblPieces.Text = "Pieces:"
        Me.lblPieces.TextAlign = System.Drawing.ContentAlignment.TopRight
        '
        'lblToolOwner
        '
        Me.lblToolOwner.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblToolOwner.Location = New System.Drawing.Point(8, 195)
        Me.lblToolOwner.Name = "lblToolOwner"
        Me.lblToolOwner.Size = New System.Drawing.Size(120, 16)
        Me.lblToolOwner.TabIndex = 43
        Me.lblToolOwner.Text = "Tool Owner:"
        Me.lblToolOwner.TextAlign = System.Drawing.ContentAlignment.TopRight
        '
        'lblSameCust
        '
        Me.lblSameCust.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblSameCust.Location = New System.Drawing.Point(8, 171)
        Me.lblSameCust.Name = "lblSameCust"
        Me.lblSameCust.Size = New System.Drawing.Size(120, 16)
        Me.lblSameCust.TabIndex = 42
        Me.lblSameCust.Text = "Same Cust/Owner:"
        Me.lblSameCust.TextAlign = System.Drawing.ContentAlignment.TopRight
        '
        'lblCustomer
        '
        Me.lblCustomer.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblCustomer.Location = New System.Drawing.Point(8, 147)
        Me.lblCustomer.Name = "lblCustomer"
        Me.lblCustomer.Size = New System.Drawing.Size(120, 16)
        Me.lblCustomer.TabIndex = 41
        Me.lblCustomer.Text = "Customer:"
        Me.lblCustomer.TextAlign = System.Drawing.ContentAlignment.TopRight
        '
        'lblLocation
        '
        Me.lblLocation.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblLocation.Location = New System.Drawing.Point(8, 123)
        Me.lblLocation.Name = "lblLocation"
        Me.lblLocation.Size = New System.Drawing.Size(120, 16)
        Me.lblLocation.TabIndex = 40
        Me.lblLocation.Text = "Location:"
        Me.lblLocation.TextAlign = System.Drawing.ContentAlignment.TopRight
        '
        'lblDescription
        '
        Me.lblDescription.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblDescription.Location = New System.Drawing.Point(8, 99)
        Me.lblDescription.Name = "lblDescription"
        Me.lblDescription.Size = New System.Drawing.Size(120, 16)
        Me.lblDescription.TabIndex = 39
        Me.lblDescription.Text = "Description:"
        Me.lblDescription.TextAlign = System.Drawing.ContentAlignment.TopRight
        '
        'lblSerialNumber
        '
        Me.lblSerialNumber.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblSerialNumber.Location = New System.Drawing.Point(8, 75)
        Me.lblSerialNumber.Name = "lblSerialNumber"
        Me.lblSerialNumber.Size = New System.Drawing.Size(120, 16)
        Me.lblSerialNumber.TabIndex = 38
        Me.lblSerialNumber.Text = "Serial Number:"
        Me.lblSerialNumber.TextAlign = System.Drawing.ContentAlignment.TopRight
        '
        'lblToolNumber
        '
        Me.lblToolNumber.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblToolNumber.Location = New System.Drawing.Point(8, 51)
        Me.lblToolNumber.Name = "lblToolNumber"
        Me.lblToolNumber.Size = New System.Drawing.Size(120, 16)
        Me.lblToolNumber.TabIndex = 37
        Me.lblToolNumber.Text = "Tool Number:"
        Me.lblToolNumber.TextAlign = System.Drawing.ContentAlignment.TopRight
        '
        'lblToolID
        '
        Me.lblToolID.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblToolID.Location = New System.Drawing.Point(8, 27)
        Me.lblToolID.Name = "lblToolID"
        Me.lblToolID.Size = New System.Drawing.Size(120, 16)
        Me.lblToolID.TabIndex = 36
        Me.lblToolID.Text = "Tool ID:"
        Me.lblToolID.TextAlign = System.Drawing.ContentAlignment.TopRight
        '
        'grdEvent
        '
        Me.grdEvent.Anchor = (((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right)
        Me.grdEvent.DataMember = ""
        Me.grdEvent.HeaderForeColor = System.Drawing.SystemColors.ControlText
        Me.grdEvent.Location = New System.Drawing.Point(8, 16)
        Me.grdEvent.Name = "grdEvent"
        Me.grdEvent.ReadOnly = True
        Me.grdEvent.Size = New System.Drawing.Size(648, 120)
        Me.grdEvent.TabIndex = 72
        '
        'grpboxComments
        '
        Me.grpboxComments.Controls.AddRange(New System.Windows.Forms.Control() {Me.rtbComments})
        Me.grpboxComments.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.grpboxComments.Location = New System.Drawing.Point(16, 248)
        Me.grpboxComments.Name = "grpboxComments"
        Me.grpboxComments.Size = New System.Drawing.Size(664, 80)
        Me.grpboxComments.TabIndex = 73
        Me.grpboxComments.TabStop = False
        Me.grpboxComments.Text = "Comments:"
        '
        'rtbComments
        '
        Me.rtbComments.Location = New System.Drawing.Point(8, 16)
        Me.rtbComments.Name = "rtbComments"
        Me.rtbComments.Size = New System.Drawing.Size(648, 56)
        Me.rtbComments.TabIndex = 0
        Me.rtbComments.Text = ""
        '
        'btnAddEvent
        '
        Me.btnAddEvent.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.btnAddEvent.Location = New System.Drawing.Point(88, 336)
        Me.btnAddEvent.Name = "btnAddEvent"
        Me.btnAddEvent.TabIndex = 74
        Me.btnAddEvent.Text = "Add &Event:"
        '
        'btnRedTag
        '
        Me.btnRedTag.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.btnRedTag.Location = New System.Drawing.Point(184, 336)
        Me.btnRedTag.Name = "btnRedTag"
        Me.btnRedTag.Size = New System.Drawing.Size(96, 23)
        Me.btnRedTag.TabIndex = 75
        Me.btnRedTag.Text = "Add &Red Tag:"
        '
        'GroupBox1
        '
        Me.GroupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.grdEvent})
        Me.GroupBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.GroupBox1.Location = New System.Drawing.Point(16, 368)
        Me.GroupBox1.Name = "GroupBox1"
        Me.GroupBox1.Size = New System.Drawing.Size(664, 144)
        Me.GroupBox1.TabIndex = 76
        Me.GroupBox1.TabStop = False
        Me.GroupBox1.Text = "Events:"
        '
        'btnLoad
        '
        Me.btnLoad.Location = New System.Drawing.Point(560, 568)
        Me.btnLoad.Name = "btnLoad"
        Me.btnLoad.TabIndex = 77
        Me.btnLoad.Text = "Load"
        '
        'frmToolTracker_EditTool
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(704, 541)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnLoad, Me.GroupBox1, Me.btnRedTag, Me.btnAddEvent, Me.grpboxComments, Me.btnClose, Me.btnSave, Me.txtCT3, Me.txtCT2, Me.txtCT1, Me.txtToolValue, Me.txtTolerance, Me.txtCalibrationFreq, Me.txtEntryDate, Me.txtEntryPerson, Me.cmbStatus, Me.lblToolValue, Me.lblTolerance, Me.lblCalibrationTarget, Me.lblCalibrationFreq, Me.lblEntryDate, Me.lblEntryPerson, Me.lblStatus, Me.txtPieces, Me.txtToolOwner, Me.txtLocation, Me.txtDescription, Me.txtSerialNumber, Me.txtToolNumber, Me.txtToolID, Me.lblPieces, Me.lblToolOwner, Me.lblSameCust, Me.lblCustomer, Me.lblLocation, Me.lblDescription, Me.lblSerialNumber, Me.lblToolNumber, Me.lblToolID})
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.Name = "frmToolTracker_EditTool"
        Me.Text = "Tool Tracker: Edit Tool"
        CType(Me.grdEvent, System.ComponentModel.ISupportInitialize).EndInit()
        Me.grpboxComments.ResumeLayout(False)
        Me.GroupBox1.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Public Sub Showdata(ByVal Dr As DataRow)
        txtToolID.Text = Dr(0)
        txtToolNumber.Text = Dr(1)
    End Sub



    Private Sub btnLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLoad.Click



        Dim frmStatusMessage As New frmStatus()
        If Not didPreviouslyConnect Then
            frmStatusMessage.Show("Connecting to SQL Server")
        End If

        Dim isConnecting As Boolean = True
        While isConnecting
            Try


                Dim ToolTracker_EventsConnection As New SqlConnection(connectionString)

                ' The SqlDataAdapter is used to move data between SQL Server,
                ' and a DataSet.
                Dim ProductAdapter As New SqlDataAdapter( _
                    "select * from TL_Events", _
                    ToolTracker_EventsConnection)

                ' Clear out any old data that has been previously loaded into
                ' the DataSet
                ToolingData.Clear()

                ' Populate the DataSet with the information from the products
                ' table.  Since a DataSet can hold multiple result sets, it's
                ' a good idea to "name" the result set when you populate the
                ' DataSet.  In this case, the result set is named "Products".
                ProductAdapter.Fill(ToolingData, TOOLING_TABLE_NAME)

                ' Bind the DataGrid to the desired table in the DataSet. This
                ' will cause the product information to display.
                grdEvent.DataSource = ToolingData.Tables(TOOLING_TABLE_NAME)

                '//////////Hide columns in SQL that don't want user to see
                Dim TS As New DataGridTableStyle()
                TS.MappingName = TOOLING_TABLE_NAME

                Dim Col As New DataGridTextBoxColumn()
                Col.MappingName = "EventID"
                Col.HeaderText = "EventID"
                Col.Width = 100
                TS.GridColumnStyles.Add(Col)

                Col = New DataGridTextBoxColumn()
                Col.MappingName = "ToolID"
                Col.HeaderText = "ToolID"
                Col.Width = 100
                TS.GridColumnStyles.Add(Col)

                Col = New DataGridTextBoxColumn()
                Col.MappingName = "EntryType"
                Col.HeaderText = "EntryType"
                Col.Width = 100
                TS.GridColumnStyles.Add(Col)

                Col = New DataGridTextBoxColumn()
                Col.MappingName = "EntryPerson"
                Col.HeaderText = "EntryPerson"
                Col.Width = 100
                TS.GridColumnStyles.Add(Col)

                Col = New DataGridTextBoxColumn()
                Col.MappingName = "Comments"
                Col.HeaderText = "Comments"
                Col.Width = 100
                TS.GridColumnStyles.Add(Col)

                Col = New DataGridTextBoxColumn()
                Col.MappingName = "EntryDate"
                Col.HeaderText = "EntryDate"
                Col.Width = 100
                TS.GridColumnStyles.Add(Col)




                grdEvent.TableStyles.Add(TS)


                '//////////End Hide Columns


                ' Now that the grid is populated, let the user filter the results.

                isConnecting = False

            Catch exc As Exception
                If connectionString = SQL_CONNECTION_STRING Then
                    ' Couldn't connect to SQL Server.  Kill The Connection.

                    frmStatusMessage.Show("Connection Dead, Killing Tool Tracker")

                    End
                End If
            End Try
        End While

        frmStatusMessage.Close()
    End Sub

    Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click
        Me.Close()
    End Sub

    Private Sub btnRedTag_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRedTag.Click
        ' Open the Red Tag Form
        Dim frmToolTracker_RedTag As New frmToolTracker_RedTag()
        frmToolTracker_RedTag.ShowDialog(Me)
        frmToolTracker_RedTag.Dispose()
    End Sub
End Class
RobertRFreeman:

I got a doubleclick feature to work fine on the same form.  I need to be able to pass it though, so I wrote up something up.  If you can help me, I will just go ahead give you both points.

https://www.experts-exchange.com/questions/21261291/Open-another-form-to-pass-the-value.html
ASKER CERTIFIED SOLUTION
Avatar of RobertRFreeman
RobertRFreeman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Very nice tutorial.  Thank you much!!
sorry, wrong post.