Change Subform within Subform record source proptery to paramter query

S

sales

I have a sub form within a sub form (3 total forms: main, sub1, sub2).
On sub form #2, I need to apply a filter. To do so, I would change the
record source to that of a parameter query. This parameter query
requires input from a control within the sub form #2.

The problem is that the parameter query cannot find the control within
sub form #2, and a prompt is displayed requesting an input value. I
need to find a way to refer to the control in sub form #2, in the
query. I tried some solutions like this but they do not work:

[Forms]![Main Form Name]![Sub form Control Name].[Sub Form #1
Name]![Sub form #1 Control Name].[Sub Form #2 Name]![Sub form #2
Control Name].[Form]![Control Name]
 
T

tina

in the query's criteria, try

[Forms]![Main]![Sub1 ControlName].[Form]![Sub2 ControlName].[Form]![Control
On Sub2]

in case you didn't know already: a subform is contained within a control on
its' parent form. the control may have the same name as the subform object
in the database window, or *it may be different*. you need to make sure
you're using the correct name. to get it:
1. open the parent form in design view.
2. click once on the subform, within the parent form, to select it.
3. in the Properties box, click the Other tab, and look at the Name
property. that's the name of the subform control.

do the above in your main form, to get the name of the sub1 subform control.
and then do it again, in the sub1 form, to get the name of the sub2 subform
control.

hth
 
M

Marshall Barton

I have a sub form within a sub form (3 total forms: main, sub1, sub2).
On sub form #2, I need to apply a filter. To do so, I would change the
record source to that of a parameter query. This parameter query
requires input from a control within the sub form #2.

The problem is that the parameter query cannot find the control within
sub form #2, and a prompt is displayed requesting an input value. I
need to find a way to refer to the control in sub form #2, in the
query. I tried some solutions like this but they do not work:

[Forms]![Main Form Name]![Sub form Control Name].[Sub Form #1
Name]![Sub form #1 Control Name].[Sub Form #2 Name]![Sub form #2
Control Name].[Form]![Control Name]

[Forms]![Main Form Name]![Subform#1 Control
Name].Form![SubForm#2 Control Name].Form![Control Name]
 

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