A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

4 subforms on each of 5 pages on a tab control



 
 
Thread Tools Display Modes
  #1  
Old March 5th, 2008, 11:21 PM posted to microsoft.public.access.forms
ragtopcaddy via AccessMonster.com
external usenet poster
 
Posts: 67
Default 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  
Old March 5th, 2008, 11:33 PM posted to microsoft.public.access.forms
ragtopcaddy via AccessMonster.com
external usenet poster
 
Posts: 67
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.