Object's parent method failed

I have MS Access 2013 and I am trying to create a search form that fills in other details when a row inside a subform is selected. I figured out how to select which row to select and which column, but now I need to pass this information to the parent form so that I can fill in other things on the form.

So, on my form form, I made an On Click event:

Option Compare Database

Private Sub Form_Click()
     MsgBox(Me.Name) ' returns P_pat subform
     MsgBox(Me.Parent.Name) ' says 'Parent' failed

      

But he can never find his parent. I also tried several other events, but the results were the same. The Access form looks like this:

enter image description here

The selected subform is the one I'm trying to work with and I want it to call the parent so that the parent can fill in its other child subform (the one below the highlighted form).

I feel like I hit a brick wall that shouldn't be, and my pride hurts.

How do I get a parent?

I know that I can just set the post id of my choice with a global variable, but I have no way to trigger an update event for another subform.

Any help or advice?

+3


source to share


1 answer


It doesn't look like there is anything wrong with your code. So, from researching it seems there are three possible solutions that I have found so far:



  • Make sure there are no special characters in your form names.
  • Compact and repair
  • Create a new empty project and import your entire database into an empty project.
+2


source







All Articles