Tab control not working with queries

  • Thread starter szag via AccessMonster.com
  • Start date
S

szag via AccessMonster.com

I have a form with a tab control on it. Within one of the tabs I have a
subform. the problem I have is that I have a button on this subform that runs
a report based on a selection within this subform. Bottom line is it appears
that the query (that the report uses) doesn't recognize the criteria - [Forms]
![F_AFE_subform]![AFE_ID] - because it is not part of the main form that the
tab control is on. Is there a way to accomplish this?
 
B

Bob Quintal

I have a form with a tab control on it. Within one of the tabs I
have a subform. the problem I have is that I have a button on this
subform that runs a report based on a selection within this
subform. Bottom line is it appears that the query (that the report
uses) doesn't recognize the criteria - [Forms]
![F_AFE_subform]![AFE_ID] - because it is not part of the main
form that the tab control is on. Is there a way to accomplish
this?
yes. To refer to a control on a subform, you must define the full
hiearchy of forms![mainformname]![subformcontrol].form![textboxname]

Note that the subform control name is not necessarily the name of the
form embedded in the main form.

see http://www.mvps.org/access/forms/frm0031.htm
 
S

szag via AccessMonster.com

Thanks Bob. I really appreciate all of the great help I have received on this
site over the years!

Bob said:
I have a form with a tab control on it. Within one of the tabs I
have a subform. the problem I have is that I have a button on this
[quoted text clipped - 4 lines]
form that the tab control is on. Is there a way to accomplish
this?

yes. To refer to a control on a subform, you must define the full
hiearchy of forms![mainformname]![subformcontrol].form![textboxname]

Note that the subform control name is not necessarily the name of the
form embedded in the main form.

see http://www.mvps.org/access/forms/frm0031.htm
 
S

szag via AccessMonster.com

still have an issue -
The main form is: F_Master_Buyer
The form on the tab contol is: F_AFE
The subform in F_AFE is: F_AFE_subform
The textbox I am trying to use from the F_AFE_subform is: AFE_ID

How would this criteria look in the query?
I have a form with a tab control on it. Within one of the tabs I have a
subform. the problem I have is that I have a button on this subform that runs
a report based on a selection within this subform. Bottom line is it appears
that the query (that the report uses) doesn't recognize the criteria - [Forms]
![F_AFE_subform]![AFE_ID] - because it is not part of the main form that the
tab control is on. Is there a way to accomplish this?
 
S

szag via AccessMonster.com

forget it - I answered my own question. thanks again.
still have an issue -
The main form is: F_Master_Buyer
The form on the tab contol is: F_AFE
The subform in F_AFE is: F_AFE_subform
The textbox I am trying to use from the F_AFE_subform is: AFE_ID

How would this criteria look in the query?
I have a form with a tab control on it. Within one of the tabs I have a
subform. the problem I have is that I have a button on this subform that runs
a report based on a selection within this subform. Bottom line is it appears
that the query (that the report uses) doesn't recognize the criteria - [Forms]
![F_AFE_subform]![AFE_ID] - because it is not part of the main form that the
tab control is on. Is there a way to accomplish this?
 
J

Jeff Boyce

Consider posting your solution... someone else may be looking for an answer
to this or a similar question some day ...

--

Regards

Jeff Boyce
Microsoft Access MVP

Disclaimer: This author may have received products and services mentioned in
this post. Mention and/or description of a product or service herein does
not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.


szag via AccessMonster.com said:
forget it - I answered my own question. thanks again.
still have an issue -
The main form is: F_Master_Buyer
The form on the tab contol is: F_AFE
The subform in F_AFE is: F_AFE_subform
The textbox I am trying to use from the F_AFE_subform is: AFE_ID

How would this criteria look in the query?
I have a form with a tab control on it. Within one of the tabs I have a
subform. the problem I have is that I have a button on this subform that
runs
a report based on a selection within this subform. Bottom line is it
appears
that the query (that the report uses) doesn't recognize the criteria -
[Forms]
![F_AFE_subform]![AFE_ID] - because it is not part of the main form that
the
tab control is on. Is there a way to accomplish this?
 
S

szag via AccessMonster.com

In the query criteria:

[Forms]![F_Master_Buyer]![F_AFE].[Form]![F_AFE_subform].[Form]![AFE_ID]

Jeff said:
Consider posting your solution... someone else may be looking for an answer
to this or a similar question some day ...
forget it - I answered my own question. thanks again.
[quoted text clipped - 16 lines]
 
D

Dirk Goldgar

szag via AccessMonster.com said:
In the query criteria:

[Forms]![F_Master_Buyer]![F_AFE].[Form]![F_AFE_subform].[Form]![AFE_ID]

For future reference, that first ".Form" qualifier is redundant. You can
write just:

[Forms]![F_Master_Buyer]![F_AFE]![F_AFE_subform].[Form]![AFE_ID]
 

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