Referencing Subform Control property from Main Form

I have a combo box (cboWellID) on a Main Form (frmInventAssign) with an AfterUpdate Event:

Private Sub cboWellID_AfterUpdate()
If Me!txtQty = 0 Then
Me!cboWellID = Null
GoTo Exit_cboWellID_AfterUpdate
Forms!frmInventAssign![sfInventAsgn].[chkDploy].Visible = True
End If

    Exit Sub

End Sub

This is meant to insure that the user has indicated a Quantity to withdraw from inventory and a Well to which it is assigned before the checkbox ("chkDploy"; Visible = No) control on a subform (sfInventAsgn) becomes visible.

When the code executes it fails with this error message:

Run-time Error 438

Object doesn’t support this property or method

How should I refer to the control ?
Who is Participating?
mbizupConnect With a Mentor Commented:
Forms!frmInventAssign![sfInventAsgn].Form.[chkDploy].Visible = True
                                                          ^----- You need "Form" here
Leigh PurvisConnect With a Mentor Database DeveloperCommented:

Forms!frmInventAssign![sfInventAsgn].Form![chkDploy].Visible = True
or just
Me![sfInventAsgn].Form![chkDploy].Visible = True
Leigh PurvisDatabase DeveloperCommented:
Ahh Science in action.
Through empirical evidence we can hypothesize that looking up a web link takes 1 minute.
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

You're quick.  It took me much longer.  Here's another one:
Leigh PurvisDatabase DeveloperCommented:
Well, I knew where to look - but had to scroll past the 30 above it ;-)
sadoiroAuthor Commented:
Thanks for the help. I had used the ".Form." on a previous iteration and received a different error message, but in solving the cause for that one I created an oops by leaving it out later. I appreciate it.
Glad to help!
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.