Subforms and Forms

  • Thread starter Thread starter Neil
  • Start date Start date
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.
 
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
 
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.

.
 
Back
Top