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 » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Go to tab (page) help



 
 
Thread Tools Display Modes
  #1  
Old August 3rd, 2009, 09:58 PM posted to microsoft.public.access.tablesdbdesign
Bob Waggoner[_2_]
external usenet poster
 
Posts: 80
Default Go to tab (page) help

I have a form with tabs that have names instead of numbers. Concerns; Enter
Complaint, etc. I want my code to open to the correct tab. How do I write
code that says, Open the complaints form and go to tab b? Everything I try
gives me an error.
The docmd.gotopage , 2 doesn't work because it says it cannot find page 2.
(My properties box shows tab1 name.... concerns; index 0. The second tab, the
one I'm trying to point to, is Name... Enter Complaints; index 1. None of the
tabs have a caption. I'm working in Access 2003 (converted from 97). Any help
would be appreciated.
Bob
  #2  
Old August 3rd, 2009, 10:56 PM posted to microsoft.public.access.tablesdbdesign
June7 via AccessMonster.com
external usenet poster
 
Posts: 173
Default Go to tab (page) help

I have code that controls which tabs are enabled depending on certain
conditions and then uses SetFocus method to make the tab active. Ex:

Private Sub Form_Open(Cancel As Integer)
ShowTabs
If Me.OpenArgs = "ViewData" Then
Me.btnFinish.Caption = "&Close"
End If
End Sub

Private Sub ShowTabs()

With Me

.tbxSet = TestSet(.tbxLABNUM, "Soils & Aggregate")

.tab1.Visible = True
.tab2.Visible = True
.tab3.Visible = True
.tab4.Visible = True
.tab5.Visible = True
.tab6.Visible = True
.tbxLABNUM.SetFocus

If Not .tbxSet Like "*1*" Then
.tab1.Visible = False
.ctr1.SourceObject = ""
End If
'... five more If Then structures
If .tab1.Visible = True Then
.tab1.SetFocus
ElseIf ...
Endif
End With
End Sub

Bob Waggoner wrote:
I have a form with tabs that have names instead of numbers. Concerns; Enter
Complaint, etc. I want my code to open to the correct tab. How do I write
code that says, Open the complaints form and go to tab b? Everything I try
gives me an error.
The docmd.gotopage , 2 doesn't work because it says it cannot find page 2.
(My properties box shows tab1 name.... concerns; index 0. The second tab, the
one I'm trying to point to, is Name... Enter Complaints; index 1. None of the
tabs have a caption. I'm working in Access 2003 (converted from 97). Any help
would be appreciated.
Bob


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...esign/200908/1

  #3  
Old August 3rd, 2009, 11:34 PM posted to microsoft.public.access.tablesdbdesign
June7 via AccessMonster.com
external usenet poster
 
Posts: 173
Default Go to tab (page) help

You are designing for other users and don't want to rely on menu/right click
data sorting and filtering but instead create controls? Use a subform or if
in Access2007 check out the new Split Form object. Have unbound controls on
main form where users enter or select from list info to base search on. Then
in Click event of button have code that changes the RecordSource or Filter
property of the subform and Requeries the RecordSource or sets Filter.

Ex of subform recordset requery, note the reference to the subform container
name:
Me.ctrSampleList.Form.RecordSource = "SELECT Submit.* " & _
"FROM Submit WHERE LabNum = '" & Me.tbxLabNum & "' ORDER BY Submit.LabNum
DESC"
Me.ctrSampleList.Form.Requery

Ex of changing form filter:
rm.RequeryMe.FilterOn = False
Me.Filter = "LabNum='" & Me.cbxLabNum & "'"
Me.FilterOn = True

Bob Waggoner wrote:
I have a form with tabs that have names instead of numbers. Concerns; Enter
Complaint, etc. I want my code to open to the correct tab. How do I write
code that says, Open the complaints form and go to tab b? Everything I try
gives me an error.
The docmd.gotopage , 2 doesn't work because it says it cannot find page 2.
(My properties box shows tab1 name.... concerns; index 0. The second tab, the
one I'm trying to point to, is Name... Enter Complaints; index 1. None of the
tabs have a caption. I'm working in Access 2003 (converted from 97). Any help
would be appreciated.
Bob


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...esign/200908/1

  #4  
Old August 3rd, 2009, 11:36 PM posted to microsoft.public.access.tablesdbdesign
June7 via AccessMonster.com
external usenet poster
 
Posts: 173
Default Go to tab (page) help

Sorry, previous post went to wrong thread (mousing clicking bungle.)

June7 wrote:
You are designing for other users and don't want to rely on menu/right click
data sorting and filtering but instead create controls? Use a subform or if
in Access2007 check out the new Split Form object. Have unbound controls on
main form where users enter or select from list info to base search on. Then
in Click event of button have code that changes the RecordSource or Filter
property of the subform and Requeries the RecordSource or sets Filter.

Ex of subform recordset requery, note the reference to the subform container
name:
Me.ctrSampleList.Form.RecordSource = "SELECT Submit.* " & _
"FROM Submit WHERE LabNum = '" & Me.tbxLabNum & "' ORDER BY Submit.LabNum
DESC"
Me.ctrSampleList.Form.Requery

Ex of changing form filter:
rm.RequeryMe.FilterOn = False
Me.Filter = "LabNum='" & Me.cbxLabNum & "'"
Me.FilterOn = True

I have a form with tabs that have names instead of numbers. Concerns; Enter
Complaint, etc. I want my code to open to the correct tab. How do I write

[quoted text clipped - 6 lines]
would be appreciated.
Bob


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...esign/200908/1

  #5  
Old August 4th, 2009, 04:29 PM posted to microsoft.public.access.tablesdbdesign
Bob Waggoner[_2_]
external usenet poster
 
Posts: 80
Default Go to tab (page) help

Thanks for your help. I stumbled onto the answer based on trying to do what
you suggested. The solution turned out to be simple:

Docmd.openform "FormName",,"",""
Docmd.gotocontrol "Tab name"

Thanks again.
Bob

"June7 via AccessMonster.com" wrote:

Sorry, previous post went to wrong thread (mousing clicking bungle.)

June7 wrote:
You are designing for other users and don't want to rely on menu/right click
data sorting and filtering but instead create controls? Use a subform or if
in Access2007 check out the new Split Form object. Have unbound controls on
main form where users enter or select from list info to base search on. Then
in Click event of button have code that changes the RecordSource or Filter
property of the subform and Requeries the RecordSource or sets Filter.

Ex of subform recordset requery, note the reference to the subform container
name:
Me.ctrSampleList.Form.RecordSource = "SELECT Submit.* " & _
"FROM Submit WHERE LabNum = '" & Me.tbxLabNum & "' ORDER BY Submit.LabNum
DESC"
Me.ctrSampleList.Form.Requery

Ex of changing form filter:
rm.RequeryMe.FilterOn = False
Me.Filter = "LabNum='" & Me.cbxLabNum & "'"
Me.FilterOn = True

I have a form with tabs that have names instead of numbers. Concerns; Enter
Complaint, etc. I want my code to open to the correct tab. How do I write

[quoted text clipped - 6 lines]
would be appreciated.
Bob


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...esign/200908/1


 




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 07:09 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.