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 / March 2008

Tip: Looking for answers? Try searching our database.

4 subforms on each of 5 pages on a tab control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ragtopcaddy - 05 Mar 2008 23:21 GMT
I have a form that has a tab control. The tab control is for yearly info
(2003,2004,etc.) and has 5 pages. Each page has 4 identical subforms
displaying monthly data (month and amount). Do I have to have 20 subforms, (4
subforms X 5 pages) or is there some method where I could use just 4 subforms
and reset the querydef when a new page is selected? I copied and pasted the 4
subforms on the first page, onto each of the other 4 pages. Consequently, the
4 subform controls on each page have the same form sourceobjects as those on
every other page.

I have a routine that rewrites the 4 qdfs based on which tab is selected, but
I'm having trouble getting the subforms to display the new query results when
I select a new page.

Signature

Bill Reed

"If you can't laugh at yourself, laugh at somebody else"

ragtopcaddy - 05 Mar 2008 23:33 GMT
OK. Once again, asking the question prodded my decrepit memory!

The 4 subform controls on each of the 5 pages are referencing the same
subform object. I implemented a numbered naming scheme ("pg1Sales",
"pg2Sales") for the controls on the tab pages. They all reference sfrmSales.
I also named the tabs for the years (2003, 2004, etc.). So, after I rewrite
the querydef to reflect the year in the page name, I just have to reset the
sourceobject:

With Me.Controls("pg" & nYr - 2002 & "Sales")
   .SourceObject = .SourceObject
End With

nYr is the year in the page name, so nYr - 2002 = 1

Damn, I'm good! Not smart, but good!

>I have a form that has a tab control. The tab control is for yearly info
>(2003,2004,etc.) and has 5 pages. Each page has 4 identical subforms
[quoted text clipped - 8 lines]
>I'm having trouble getting the subforms to display the new query results when
>I select a new page.

Signature

Bill Reed

"If you can't laugh at yourself, laugh at somebody else"

 
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.