Form/subform query

  • Thread starter Thread starter Mike Collard
  • Start date Start date
M

Mike Collard

I have 3 forms A B & C. A is the main form that contains
B & C as subforms.

B contains several text boxes that are used as query
parameters.

The source of C is the query that uses the criteria from B
and it should display the results.

If I open B as a main form and enter the criteria then
form C displays the results.

However, if I open form A with B & C as subforms and enter
the criteria in subform B then subform C does not display
the results. But if I additionally open form B, then
subform C displays the results.

Regret this all seems a bit garbled but hope it is
understandable.

Grateful for any help.

Mike C
 
Presumably the Criteria row of the query for form C contains something like
this:
[Forms]!![SomeTextBox]

If so, you will find that subforms are not open in their own right, i.e.
they are not part of the Forms collection. You will need to change the
reference to something like:
[Forms]![A]!.[Form]![SomeTextBox]

If the ".Form" bit doesn't make sense, see:
Referring to Controls on a Subform
at:
http://allenbrowne.com/casu-04.html
 
Allen

Thanks

I did eventually hit on a solution although I did try
using the indirect reference to the subform you suggest
and that did not work either. The solution, in part, was
to change the underlying query to an append query.

Mike Collard
-----Original Message-----
Presumably the Criteria row of the query for form C contains something like
this:
[Forms]!![SomeTextBox]

If so, you will find that subforms are not open in their own right, i.e.
they are not part of the Forms collection. You will need to change the
reference to something like:
[Forms]![A]!.[Form]![SomeTextBox]

If the ".Form" bit doesn't make sense, see:
Referring to Controls on a Subform
at:
http://allenbrowne.com/casu-04.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I have 3 forms A B & C. A is the main form that contains
B & C as subforms.

B contains several text boxes that are used as query
parameters.

The source of C is the query that uses the criteria from B
and it should display the results.

If I open B as a main form and enter the criteria then
form C displays the results.

However, if I open form A with B & C as subforms and enter
the criteria in subform B then subform C does not display
the results. But if I additionally open form B, then
subform C displays the results.

Regret this all seems a bit garbled but hope it is
understandable.

Grateful for any help.


.
 
Back
Top