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  

Tabbed Form Design



 
 
Thread Tools Display Modes
  #1  
Old May 7th, 2008, 05:57 AM posted to microsoft.public.access.forms
G2
external usenet poster
 
Posts: 4
Default Tabbed Form Design

How do I create a tabbed form, where the tab names and number of tabs will
change based on the outcome of a "group-by" query? (or the unique values in
one field of a table). Or am I asking too much from a tabbed form?
  #2  
Old May 7th, 2008, 10:01 AM posted to microsoft.public.access.forms
Brendan Reynolds
external usenet poster
 
Posts: 1,241
Default Tabbed Form Design

"G2" wrote in message
...
How do I create a tabbed form, where the tab names and number of tabs will
change based on the outcome of a "group-by" query? (or the unique values
in
one field of a table). Or am I asking too much from a tabbed form?



You can add tabs to a form programmatically, but the form must be open in
design view. It's generally better to create the maximum number of tabs you
will need at design time, and toggle their visibility at run time, which
does not require the form to be in design view.

Here's an example that gets the number of tabs and their captions from text
boxes on the form ...

Private Sub cmdBuildTabs_Click()

Dim lngPages As Long
Dim lngLoop As Long
Dim varCaptions As Variant

lngPages = CLng(Me.txtNumPages)
varCaptions = Split(Me.txtTabNames, " ")

For lngLoop = 0 To Me.tabTest.Pages.Count - 1
Me.tabTest.Pages(lngLoop).Visible = False
Next lngLoop
For lngLoop = 0 To lngPages - 1
Me.tabTest.Pages(lngLoop).Visible = True
Me.tabTest.Pages(lngLoop).Caption = varCaptions(lngLoop)
Next lngLoop

End Sub

--
Brendan Reynolds

 




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 01:14 AM.


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