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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Criteria erria

Status
Not open for further replies.

Hawkide

Technical User
Oct 8, 2003
159
US
I know this must be simple, but I am totally stuck. TIA...

If I try to enter the following as a criteria of a query:

[Forms]![frmMetricsReports]![tab1].Pages(tab1).name

I get the following error:

The expression you entered has an invalid . (dot) or ! operator or invalid parenthesis.
You may have entered an invalid identifier or typed parenthesis following th enull constant


The statement is a valid VBA statement in my code, but returns the aforementioned error as a criteria in my query.

What I am trying to accomplish is this: The criteria is supposed to be the name of active page of tab1, where tab1 is a tab control
 
Either create a public function returning the tab name or have an hidden textbox in the main form holding this value for the query.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I tried the hidden textbox approach. There is a slight issue. The query is actually the Row Source for a combobox. The results from the query are dependent upon which page of the tab control is active.

Now that I have the hidden textbox, the combobox displays the correct info when selected. [red]However[/red], when I change the page of the tab control and reselect the combobox still displays the same results even though the the page has been changed. It is as though the query is only being run the first time the combobox is selected. Is there a way to refresh the query when the combpobox is selected again?
 
Perhaps this, provided the textbox holds the current value:
yourComboName.RowSource = yourComboName.RowSource

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Sorry...It looks like the ReQuery method of the combobox works if I put it in the OnEnter event. Thanks for the ideas.

Was my first approch completly not doable (ie trying to write it as [Forms]!...)? If so is there a quick explanation as to why.?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top