hi
I'm having trouble with using a linked form instead of a sub form on a 1 to many relationship. Then linked form can be accessed from various other forms. When it opens the linked form, if there are no records the clientID is 0.
I tried the code behind the button to open the linked form.
I would set the default value of ClientID to:
Forms!frmMain!ClientID
but as the parent form could be any of many I need to find another way.
Help
Lou
I'm having trouble with using a linked form instead of a sub form on a 1 to many relationship. Then linked form can be accessed from various other forms. When it opens the linked form, if there are no records the clientID is 0.
I tried the code behind the button to open the linked form.
Code:
stLinkCriteria = "[ClientID]=" & Me![ClientID]
DoCmd.OpenForm "frmLinked", , , stLinkCriteria
If Forms!frmMain!ClientID = 0 Then
Forms!frmLinked!ClientID = Forms!frmMain!ClientID
End If
I would set the default value of ClientID to:
Forms!frmMain!ClientID
but as the parent form could be any of many I need to find another way.
Help
Lou