close PARENT form when click on the subform

Experts,
I have a Parent / Sub.
I click on the sub:  txtEndUser and want the Parent to close.  
As you can see from below I am trying to the sub and it does not do anything so the Parent stays open after I click.

How do I get the Parent to close on the click event in the subform?
I would rather not use Forms!frmParent
Thank you

Private Sub txtEndUser_Click()

    DoCmd.Close acForm, Me.Name
    DoCmd.OpenForm "End User Details", , , "EndUserID =" & Me.txtEndUserID
   
    'Me.Visible = False
    'DoCmd.Close acForm, Me.Name
   
End Sub
pdvsaProject financeAsked:
Who is Participating?
 
Rey Obrero (Capricorn1)Commented:

Private Sub txtEndUser_Click()

    DoCmd.Close acForm, Me.Parent.name
    DoCmd.OpenForm "End User Details", , , "EndUserID =" & Me.txtEndUserID
   
 
   
End Sub
0
 
Rey Obrero (Capricorn1)Commented:
try

Private Sub txtEndUser_Click()

    DoCmd.Close acForm, Me.Parent
    DoCmd.OpenForm "End User Details", , , "EndUserID =" & Me.txtEndUserID
   
 
   
End Sub
0
 
pdvsaProject financeAuthor Commented:
Yes!  thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.