Subforms and Forms

N

Neil

I have a subform made by dragging a table to the parent
form. This subform has combo boxes with a query based
criteria such that what is selected in the left most box
affects what is shown in the other boxes.

What happens is that when I run the subform by itself,
everything functions as it should. When I run the parent
form I get an error response asking for a parameter to be
entered.
 
S

Steve Schapel

Neil,

I guess that you have a criteria in a query which refers to a control
on the form which you are using for the subform, with syntax such
as...
[Forms]![NameOfForm]![NameOfControl]
This will not work if the form is being displayed in a subform. The
form is not actually open, and therefore you have to refer to it as
part of the main form, in one of these two ways...
[Forms]![NameOfMainForm]![NameOfSubform]![NameOfControl]
[Forms]![NameOfMainForm]![NameOfSubform].[Form]![NameOfControl]

- Steve Schapel, Microsoft Access MVP
 
G

Guest

Thank you Steve!
-----Original Message-----
Neil,

I guess that you have a criteria in a query which refers to a control
on the form which you are using for the subform, with syntax such
as...
[Forms]![NameOfForm]![NameOfControl]
This will not work if the form is being displayed in a subform. The
form is not actually open, and therefore you have to refer to it as
part of the main form, in one of these two ways...
[Forms]![NameOfMainForm]![NameOfSubform]![NameOfControl]
[Forms]![NameOfMainForm]![NameOfSubform].[Form]! [NameOfControl]

- Steve Schapel, Microsoft Access MVP


I have a subform made by dragging a table to the parent
form. This subform has combo boxes with a query based
criteria such that what is selected in the left most box
affects what is shown in the other boxes.

What happens is that when I run the subform by itself,
everything functions as it should. When I run the parent
form I get an error response asking for a parameter to be
entered.

.
 

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