SteveL13
asked on
Trying to populate vale of a field in a sub-form with the value of a field on a forms sub-form
I have a hyperlink field in a sub-form or a main form. When the user clicks the hyper link I have a 3rd form opening and want a field on that 3rd form to populate with the value of the clicked hyperlink.
Here is my code that opens the 3rd form which works fine...
And here is my default value syntax for the field on the 3rd form which isn't working.
=[Forms]![subfrmTeamsPlaye rsByDivisi onDS]![txt ID]
Here is my code that opens the 3rd form which works fine...
Private Sub txtID_Click()
If DCount("*", "tblPlayerNotes", "PlayerId=" & Me.txtPlayerID) > 0 Then
DoCmd.OpenForm "subfrmPlayerNotes", acNormal, , "[PlayerID]=" & Me.txtID, , acWindowNormal
DoCmd.Restore
Else
DoCmd.OpenForm "subfrmPlayerNotes", acNormal, , , acFormAdd, acWindowNormal
DoCmd.Restore
End If
End Sub
And here is my default value syntax for the field on the 3rd form which isn't working.
=[Forms]![subfrmTeamsPlaye
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
So I'm curious - which way did you end up doing this?
ASKER
Your way. I am still trying to find out how to refer to forms and their subforms and other subforms. I stumble over that every time.
Just remember that a Subform is ALWAYS in a Subform Control - so just like every other Control on a Form, you must first refer to the Control, and you can then refer to other properties/methods/attribu tes of that control.
ASKER
Thank you for the valuable information. I do appreciate it.