Thanks for the pointers.
I have found some code see below, that does something along the lines of what I am after.
'DataGridView Form
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm As New DetailForm
'This assumes the GUID is in cell 0 which normally would not be displayed in the datagridview since it's value has no meaning to the user.
frm.Guid = DataGridView1.CurrentRow.Cells(0).Value
frm.Show()
End Sub
'Detail Form
Public Class DetailForm
Private myGuid As System.Guid
Public Property Guid() As System.Guid
Get
Return myGuid
End Get
Set(ByVal value As System.Guid)
myGuid = value
End Set
End Property
Private Sub DetailForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim myTA As New myDSTableAdapters.TableNameAdapter
Dim myDT As New myDS.TableNameTable
myTA.FillBy(myDT, myGuid)
End Sub
End Class
I have tried to use the code within my project, but there are to many differences to correct, for example I am not using guid for a id column I am using simply numeric 18,0 with auto increment within the sql table, I would however like to say this is the ID column for the main records.
The forms I am using are searchaccident, which has the datagridview on it, also frmAddAccident, this form is also used to add a new row to the table addaccident, can it be used again for updating an existing record?
I have added a query =@idparam, getdataby1 to the table adapter ready for use in this part.
Sorry for the noobie qusetions also the explanation as to what I am trying to do. not very good at explaining what I want.
Thanks in advance
Tony G