Tab Controls and underlying query criteria

  • Thread starter Thread starter maureen
  • Start date Start date
M

maureen

I have a form with multiple tab controls
There is a subform on each tab control - each subform
contains a field that links it to the preceeding subform -
relationships are set.

Each subform was created from a Query which contains
criteria to limit the records being displayed - The
criteria requires that the records displayed will have a
specific fieldID value which equals that on the
preceeding tab control.

All queries work when the query is run. All queries work
in individual forms...it's when I try to put them all in
a single form using tab controls that the criteria in the
underlying query seems to get ignored.

Any help will be greatly appreciated!
 
In query for subforms, limit field to match form.

In query, criteria field for the ID put something like:

[Forms]![frmPlanBasicInfo]![PresentationID]
 
The criteria for each query that is the base for the
subforms on the tab controls all work when I open the
Query - it's when I open the subform on the tab control
that the criteria in the underlying query is not getting
recognized.

I'm trying to build a series of successive screens using
the tab control pages. Each tab has a subform - all
related by one common field that is on the original tab.
I'm also trying to bring in a 2nd field of criteria which
is getting recognized in the query itself but is getting
lost when viewed through a subform on a tab.

HELP PLEASE!
-----Original Message-----
In query for subforms, limit field to match form.

In query, criteria field for the ID put something like:

[Forms]![frmPlanBasicInfo]![PresentationID]


I have a form with multiple tab controls
There is a subform on each tab control - each subform
contains a field that links it to the preceeding subform -
relationships are set.

Each subform was created from a Query which contains
criteria to limit the records being displayed - The
criteria requires that the records displayed will have a
specific fieldID value which equals that on the
preceeding tab control.

All queries work when the query is run. All queries work
in individual forms...it's when I try to put them all in
a single form using tab controls that the criteria in the
underlying query seems to get ignored.

Any help will be greatly appreciated!

.
 
maureen said:
I have a form with multiple tab controls
There is a subform on each tab control - each subform
contains a field that links it to the preceeding subform -
relationships are set.

Each subform was created from a Query which contains
criteria to limit the records being displayed - The
criteria requires that the records displayed will have a
specific fieldID value which equals that on the
preceeding tab control.

All queries work when the query is run. All queries work
in individual forms...it's when I try to put them all in
a single form using tab controls that the criteria in the
underlying query seems to get ignored.

Any help will be greatly appreciated!

Post the SQL from one of these queries. It sounds to me as though the
query has a criteriton that refers to a control on a form via a
"Forms!FormName!ControlName" reference, but the form that it refers to
is not now open as a main form, but instead is only open as a subform.
Subforms are not members of the Forms collection, and so can't be
referred to directly that way. Instead, you have to go through the main
form and the Form property of the subform *control* on that main form;
along these lines:

Forms!MainForm!sfSubformName.Form!ControlName

In the above, "MainForm" is the name of the main form, "sfSubformName"
is the name of the subform control on that form, the control that acts
as a window on the form object being used as a subform, and
"ControlName" is the name of the control on that form.
 
Back
Top