Many thanks for you kind help. Yes I did have code the relevant code in both forms.
Anyhow I've come up with a solution which is a combination of your help and another post on this site that seems to do the trick just fine.
With no small amount of help form JemJoo here's my two pence worth.
I’m posting this in the hope it helps someone else as much as it helped me.
To anyone who needs to open a child form and show related records from a parent form. You might need to adapt the code to suite your needs but you'll find the idea is sound.
Being new to Visual Studio and VB2008 I trawled around the net for an age and read copious amounts of text as well as asking for help, just to complete, what seems on the surface, a very simple process, well it was in days of Access (pre 2007).
Seems MS are hell-bent on re-inventing the wheel and, for the likes of me, in the process making code so much harder to understand.
All I wanted to do was click a row in a grid to open a second form a showing details of the clicked row. The only marginally tricky thing was that the second form is accessed from more then one grid so the code needs to be pushed from the first form rather then pulled from the second.
Anyhow, thanks to DaniWeb and some kind soles I managed to put together bits from a couple of posts that does the trick. I'm not saying this the best way of doing the job and I'm pretty sure someone will come along and do this as a one liner, but it works.
CODE FOR FORM A (which contains a gridview named TblCustomersDataGridView)
Public Class FormA
Private Sub FormA_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'This line of code loads data into the 'CustomerDataSet.TblCustomers' table. Me.TblCustomersTableAdapter.Fill(Me.CustomerDataSet.TblCustomers)
End Sub
Private Sub TblCustomersDataGridView_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
Dim FormB As New FormB
Dim PassingID As Integer = Me.DataGridView1.CurrentRow.Cells(0).Value()
FormB.PassedText = PassingID
FormB.ShowDialog()
End Sub
End Class
CODE FOR FORM B
Public Class FormB
Private _passedText As Integer
Public Property [PassedText]() As Integer
Get
Return _passedText
End Get
Set(ByVal Value As Integer)
_passedText = Value
End Set
End Property
Private Sub FormB_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.LblViewID.Text = _passedText
'This line of code loads data into the 'CustomerDataSet.TblCustomers' table.
Me.TblCustomersTableAdapter.Fill(Me.CustomerDataSet.TblCustomers)
Me.TblCustomersBindingSource.Position = Me.TblCustomersBindingSource.Find("CustomerID", _passedText)
End Sub
End Class
Tip: write the code for form B first and you wont get the little blue squiggly line when writing code for form A