I have a form for table1 with PK and a form for table2 with FK. I pull records from table1 and onClick want fields in form for table2 to populate based on PK from table1. Both forms are MDIChild.

(Frm1)

Private Sub cmdCourses_Click()
progField = txtField(1)
MyRs.Close
strSQL = "SELECT * FROM table2 WHERE FK = '" & progField & "'"

Set MyRs = New ADODB.Recordset
MyRs.Open strSQL, MyConn, adOpenDynamic, adLockOptimistic

frmTable2.Text1.Text = MyRs.Fields(0).Value
frmTable2.Show

End Sub

Can anyone help, I'm brain dead 2day