How do I replicate the Link Child/Master fields
functionality between two forms if none of these forms
are subforms?
i.e. how do I automatically update the related records in
a form when I change to a new record in a main form?
With a fair bit of VBA code, unfortunately.
Note that the Master/Child subform relationship does considerably more
than what you describe: it also causes new records on the subform to
inherit the value of the master link field.
The simplest way to do what you describe is to put VBA code in the
"master" form's Current event to change the "child" form's
Recordsource; for example -
Private Sub Form_Current()
Dim strSQL As String
If Not Me.NewRecord Then ' can't link from a blank record
strSQL = "SELECT this, that, theother FROM childtable" _
& " WHERE childtable.LinkField = " & Me!MasterField
Forms!ChildForm.Recordsource = strSQL
End If
' set the Default property so new records stay in synch
' Default is a String property so surround it with quotes
Forms!ChildForm!txtChildField.DefaultValue = _
Chr(34) & Me!MasterField & Chr(34)
End Sub
Why not use a Subform? Let Access do the work for you!
John W. Vinson[MVP]