Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

accessing field on a subform on a tab contianer

Status
Not open for further replies.

aplusmk

Programmer
Apr 1, 2003
6
US
I am trying to run a query that uses a where clause that points to a field on a form that contains tabs. On one of these tabs I have a sub form. On the where clause of the query I am trying to point to the field on the tab, but it does not seem to recognize it. Any help would be greatly appreciated.
Where clause:

WHERE ((([wpr_component].[Component ID])=form![wpr_components]!wpr_component_tab));

form with the tab is wpr_tab
subform on page two of the tab is wpr_components
field on wpr_components is wpr_component_tab
 
Hi!

Try (if I've understood correctly):

[tt][forms]![wpr_tab]![wpr_components].Form![wpr_component_tab][/tt]

Here's a Microsoft link on How to Refer to a Control on a Subform or Subreport

- note - you must use the subform control name, which might be different from the name seen in the database window

Roy-Vidar
 
Thanks for the quick answer, but I'm still having problems. I get the message box asking me to enter the parameter value forms!wpr_tab etc.

When I take this out of the tab control it works, but does not seem to work in the tab control. Do I have to refer to the page of the tab control somehow?

 
Mor information on this problem

main form is wpr_tab
tab control is ctl0
form on page two of tab control is wpr_components
text field I am trying to filter on with the where clause is wpr_components_tab
 
No, there's no need to refer to thru the tab.

Might have been a bit hasty when replying too, try also without the [brackets] on the Forms keyword.

There might be a challenge concerning usage of the subform name versus the subform control name:

The easiest would probably be to have the form open, then open the query in design view (or any query for thats sake), use the build thingie in the criteria row (right click) to get to the expression builder, double click thru forms, loaded forms, main form, subform, and finally the control, then hit OK, and you should have the correct reference.

Roy-Vidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top