Refer to Subform control in Query

sluggercoach

Registered User.
Local time
Today, 02:53
Joined
Jun 12, 2007
Messages
21
I am about to go crazy! I have something that I know should be easy that I cannot get to work. I have an application that has a form with several subforms on it. The user opens the forms and I need to be able to allow them to view a report to show more details about what they selected in the form. So, my query needs to use a control on one of the subforms as criteria. For the life of me I cannot get it to work. I have tried it every way I can and nothing. What is the correct syntax to use a control from a subform as criteria in a query?

frmDCNNavigator is my main form. frmDCN# is the subform I am interested in. DCN# is the control whose value I want to be my criteria.
I have tried:
forms!frmDCNNavigator!frmDCN#!DCN#
and forms!frmDCNNavigator!frmDCN#.form![DCN]
etc., etc.
 
This works for me

[Forms]![Masterform]![SPP]![CoverageType]

With [SPP] being the subform and [CoverageType] being the field in the subform.

What I am using displays all the records for the underlying table where the entry in CoverageType is the same as the record on the subform.


If I did not use [ ] then they will add in themselves. Perhaps your field name having # is not helping.

I am using A2003.
 

Users who are viewing this thread

Back
Top Bottom