Refer to Subform Controls

J

Joe Williams

I have a main form named "NCMR By Part"
I have a sub form named "NCMR By Part Sub"
I have a control on the subform named "NCMR"

I am trying to open another form using the control from the sub form as the
WHERE CONDITION. The statement looks like this:

DoCmd.OpenForm "NCMR Update", acNormal, , "[NCMR] = forms![NCMR By
Part]![NCMR By Part Sub].[Form]![NCMR]"

I am getting an input prompt "Enter Parameter Value: and Forms!NCMR By
Part!NCMR By Part Sub.Form!NCMR like it can't resolve the path to the
subform control."

Any ideas?

THanks,

joe
 
M

Marshall Barton

Joe said:
I have a main form named "NCMR By Part"
I have a sub form named "NCMR By Part Sub"
I have a control on the subform named "NCMR"

I am trying to open another form using the control from the sub form as the
WHERE CONDITION. The statement looks like this:

DoCmd.OpenForm "NCMR Update", acNormal, , "[NCMR] = forms![NCMR By
Part]![NCMR By Part Sub].[Form]![NCMR]"

I am getting an input prompt "Enter Parameter Value: and Forms!NCMR By
Part!NCMR By Part Sub.Form!NCMR like it can't resolve the path to the
subform control."


Except for being the long way to reference it, the reference
is OK, the problem is that it's can't be resolved in that
context. Try witing it this way:

DoCmd.OpenForm "NCMR Update", acNormal, , _
"[NCMR] =" & Me.NCMR
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top