Query from TAB Control.

Equine Investor

Board Regular
Joined
Nov 20, 2002
Messages
103
I'll try and give as much info as possible so you understand my dilemma.

My form is called "search"

I have a query which uses values from a text boxes on "search" like this:

Between Nz([Forms]![SEARCH]![TABMin],1) And Nz([Forms]![SEARCH]![TABMax],24)

So there are minimum and maximum values that the user inputs into the text boxes and then presses a command button to run the query.

This is my problem.....

There are so many text boxes on my form, that I want to use TAB Control pages and insert them into form "search".

Can someone walk me through the process please as I have tried this:

Between Nz([Forms]![SEARCH]![MENU]![TABMin],1) And Nz([Forms]![SEARCH]![MENU]![TABMax],24)

And it doesn't work.

Could you please explain what I need to include in my query?

Example: Do I need to incorporate the name of the main form "search" and/or the name of the TAB Control Box and/or the Page number as well, to have it work or is my command button on the "search" form not linking to the TAB Control box?

I would like to be able to press one button to incorporate queries on the main form AND on the TAB control box.

Any help appreciated.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi Equine Investor,

By using the expression builder, all things will be made clear.

In the design view of the query for which you want to have this textbox-based cirteria, right click in the field where you would enter the criteria for the field you need. Select 'Build', and the expression builder will pop up. From here, find the control of interest from the folders on the left part of the window, and the syntax will be taken care of for you. I like to open the form first so it is listed in 'open forms', so its easy to find. Sometimes the control you're looking for isn't where you'd expect it to be.

For what its worth, controls directly on tabs are referred to as if the tab wasn't there. So for your example, it would probably end up like:
[forms]![SEARCH].[TABMin]

If you are using subforms embedded in the tabs, you would refer to controls on it like:
[Forms]![SEARCH]![MENU].[Form]![TabMin]

Just experiment with the expression builder, it will save you a lot of headaches.

Hope this helps,
 
Upvote 0
Corticus,

Many thankyous for your reply.

I finally figured out from your reply what I was doing wrong.

I was cutting from the original form and pasting onto the TAB Control the text boxes.
Apparently you have to rename them because the name automatically changes when pasted onto a new object.

Works great now and more user friendly ;)

Thanks again.
 
Upvote 0

Forum statistics

Threads
1,221,618
Messages
6,160,872
Members
451,674
Latest member
TJPsmt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top