If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
4 subforms on each of 5 pages on a tab control
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. -- Bill Reed "If you can't laugh at yourself, laugh at somebody else" Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/For...forms/200803/1 |
#2
|
|||
|
|||
4 subforms on each of 5 pages on a tab control
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! ragtopcaddy wrote: 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. -- Bill Reed "If you can't laugh at yourself, laugh at somebody else" Message posted via http://www.accessmonster.com |
Thread Tools | |
Display Modes | |
|
|