Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / February 2008

Tip: Looking for answers? Try searching our database.

Tab Control query problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Cathy - 01 Feb 2008 15:53 GMT
I have a tab control on a form with two tabs.  

The first tab has drop downs for the month/year and other criteria.  It also
has a button to run a query based on all of the criteria displayed on the
form.

The second tab also has drop downs for the month/year and different
criteria.  It also has a button to run a query based on all of the criteria
displayed on the form.

My problem is that when I am on the second tab, it picks up the month/year
field from the first tab in the query results.  I does pick up all of the
'other criteria' from the second tab.  How do I correct this?

Thank you!
Dirk Goldgar - 01 Feb 2008 16:09 GMT
>I have a tab control on a form with two tabs.
>
[quoted text clipped - 11 lines]
> field from the first tab in the query results.  I does pick up all of the
> 'other criteria' from the second tab.  How do I correct this?

If you have different combo boxes on each tab, then they must have different
names.  Check their names.  From the sound of it, either the query being run
on the second tab is referring directly to the combo boxes on the first tab
(as criteria), or else the code behind the button on the second tab is
mistakenly using the combos on the first tab as filters when opening the
second tab's query.  Check the query, and check the code.  If you can't
figure out what to do, post the SQL of the query and the code behind the
button.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

George Nicholson - 01 Feb 2008 16:18 GMT
MyTabControl, MyDateTimeOnTabOne and MyDateTimeOnTabTwo are all members of
the MyMainForm.Controls collection, and as such, must have unique names.
Individual tabs do not have their own Controls collections.

> My problem is that when I am on the second tab, it picks up the month/year
> field from the first tab in the query results.

Given the above, I'm not sure how that is possible unless you are
referencing the same control in both queries. How are you referencing them
in the queries? (i.e., how are your queries "picking up" values?). I assume
we are talking different queries for tab one and two.

Signature

HTH,
George

>I have a tab control on a form with two tabs.
>
[quoted text clipped - 13 lines]
>
> Thank you!
Cathy - 01 Feb 2008 18:41 GMT
I've never worked with queries against tabs before, and I didn't build this
application... But your diagnosis was correct.  It had the same control names
on both tabs for the month and year.

Thank you so much.  Your fix works perfectly.

> MyTabControl, MyDateTimeOnTabOne and MyDateTimeOnTabTwo are all members of
> the MyMainForm.Controls collection, and as such, must have unique names.
[quoted text clipped - 25 lines]
> >
> > Thank you!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.