422,904 Members | 1,030 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 422,904 IT Pros & Developers. It's quick & easy.

Tab Control on certain pages

P: 12
I have a single form with a Tab Control containing 4 tabs with list boxes on 2 tabs. I have navigation tabs on the first tab and it controls all the tabs. The list boxes contains different data.

I want the navigation tabs to work only in tabs 1 and 2 but a second navigation tab to work on tabs, 3 and 4.

How do I go about that?
3 Days Ago #1
Share this Question
Share on Google+
17 Replies


twinnyfo
Expert Mod 100+
P: 2,415
ijared,

I would love to help, but your description is a bit confusing.

I know what a Tab Control is, but what do you mean by "navigation tabs"?

Is this within the confines of a Navigation Form?

Any additional information you can provide would help guide us to a solution.
3 Days Ago #2

P: 12
It is the Navigation Buttons that starts with First Back Next Last New to create or edit records.
3 Days Ago #3

twinnyfo
Expert Mod 100+
P: 2,415
ijared,

This is not helping much.

At this point, I have no idea whatsoever what you are talkling about.

There are Navigation Forms--which is a type of form) and there are Navigation Controls that can be displayed on your ordinary forms. You can also create Command buttons that perform the same functions as the Navigation Controls.

However, you still haven't explained anything about the navigation buttons/tabs/controls being on the first tab of your Tab Control, nor what you are really trying to do.

You have to give us ample information if you want any type of assistance on this forum.
3 Days Ago #4

NeoPa
Expert Mod 15k+
P: 30,842
TwinnyFo:
You have to give us ample information if you want any type of assistance on this forum.
Or anywhere. That's the point.

We don't demand you work for your supper. We merely request the most basic understanding of what you're trying to ask about. No-one anywhere can help you unless you express what it is you want help with. We're not here to demonstrate psychic abilities.
3 Days Ago #5

zmbd
Expert Mod 5K+
P: 5,087
From ijared second description it sounds like the record-navigation controls


iJered
Open your form... windows 7 and newer has the Snipping tool, use that tool to capture an image of your form.

Under the reply box there is a button labeled [Advanced]


click on this button which will take you to the advanced post editor where you can upload the image to your post...


please don't use links to third-party image sites as these are often blocked by company firewalls - upload image from your PC to the site.

In this case, a picture will be worth a thousand words!
Attached Images
File Type: jpg BoundFormRecordNavigation.jpg (18.3 KB, 31 views)
File Type: jpg forumAdvanced.JPG (16.0 KB, 34 views)
File Type: jpg attach.jpg (16.8 KB, 32 views)
2 Days Ago #6

P: 12
It directs the images I have on the different tabs. I want the navigation tabs to work only for 1 and 2 tabs and a second button to control tabs 3 and 4 but a second navigation tab to work on tabs, 3 and 4.

Attached Images
File Type: jpg navigation buttons.jpg (18.2 KB, 28 views)
2 Days Ago #7

twinnyfo
Expert Mod 100+
P: 2,415
I want the navigation tabs to work only for 1 and 2 tabs and a second button to control tabs 3 and 4 but a second navigation tab to work on tabs, 3 and 4.
Please explain what you mean, as you have mentioned this before and it didn’t make sense either. Your picture, although it might have helped, now adds more confusion, because you have now shown us TWO sets of navigation buttons.

Please provide more details of what you are trying to do, not just repeating what we don’t understand.
2 Days Ago #8

zmbd
Expert Mod 5K+
P: 5,087
@ ijared
While I appreciate the effort to provide only the pertinent parts of your form - what I asked you for was a FULL capture of your form so that we can see what you have done.

Also do you understand what the main intent of the TabControl was originally designed for? Are you using subforms within your TabControl?

@ twinnyfo
:)
Piecing together what we have:
- I would appear that OP has found a form or control that is similar to what is needed
- From the sniped image it looks like a Main Form with some home-grown-record-navigation buttons (HGRN)with the HGRN siting on main form and OP has neglected to remove the standard form-record-navigation when the TabControl was inserted on the main form

!! now for the huge guess
OP wants one set of HGRN to work for
Me.ctrlTab.Pageindex = 1 and 2

and a different set of HGRN for
Me.ctrlTab.Pageindex = 3 and 4


There is really no need for a second set of HGRN as one can simply pull the index:
https://bytes.com/topic/access/answe...tab-active-vba
and then perform a set of actions depending on the active page.

You can get a bit more granular by naming the tab-pages and calling them directly... FMSINC has a nice tutorial and a sample database that shows this code.
FMS: Reference Tab Pages by its PageIndex Rather than Tab Value on Microsoft Access Forms

I further suspect that the native record controls need to be hidden; however, without the full form image capture it's impossible to tell.
1 Days ago #9

NeoPa
Expert Mod 15k+
P: 30,842
BTW As FMS Inc is a web page provided by another Access MVP (My friend and colleague Luke Chung) I believe that linking to there is acceptable.
1 Days ago #10

P: 12
Hi,
I hope this image will help. As I said before, I want the navigation tabs to work only for 1 and 2 tabs and a second button to control tabs 3 and 4.but a second navigation tab to work on tabs, 3 and 4.
ijared

Attached Images
File Type: jpg test22.jpg (62.2 KB, 20 views)
1 Days ago #11

twinnyfo
Expert Mod 100+
P: 2,415
Apparently we are not making ourselves clear enough. Your description still does not make any sense.

As I said before
The first few times you said the same thing, and we still don’t understand. Perhaps describe it differently, rather than saying the same thing and assuming we will somehow figure out what you mean.

I want the navigation tabs to work only for 1 and 2 tabs
What are “navigation tabs”?? If all your tabs are linked to the same set of records, then it doesn’t matter, and navigation will affect all tabs.

a second button to control tabs 3 and 4
Is this “button” the same as your “navigation tabs”? Consistent language is not just helpful, it is a necessarily when working on a forum like this. Concerning just tabs 3 & 4, see above.

but a second navigation tab to work on tabs, 3 and 4.
Is this a typo? Is this something different than your “second button”? Is this another control? What is a “navigation tab”?

I hope you can appreciate the immense level of patience many of the experts on this forum have already exercised with this thread. Believe it or not, we really do want to help you. However, every time we ask for additional details, you never answer our questions directly and seem to only restate what you have already stated. We cannot help you if you don’t provide us meaningful descriptions of what we ask for.
1 Days ago #12

PhilOfWalton
Expert 100+
P: 1,183
Unlike Neopa, I am psychic ( well partially).

I think what ijared wants is to show his custom command buttons for "First", "Next", "Back" & "Last" only when Pages 1 and 2 of his Tab control are active.

I am not psychic enough to understand on which pages he wants to display "Delete" & "New"

"but a second navigation tab to work on tabs, 3 and 4." eludes me completely.

If, ijared, when you reply, please use the correct terms, and then we will be able to help.

At the bottom of your form you have 6 Command Buttons:- "First", "Next", "Back", "Last", "Delete" & "New"

The 4 items at the top of the form which I can't read but start with "vo" or "No Longer" are Pages on a Tab Control

If you click immediately to the right of the last page "Volutoor #" the property box will confirm that you are on a Tab Control

Phil
1 Days ago #13

P: 12
Sorry for the disturbance it is taking. The navigation tabs are the 6 Command Buttons:- "First", "Next", "Back", "Last", "Delete" & "New" showing in the picture and I understand that the navigation will affect all tabs.
I waant it to affect only the first 2 tabs so the 3 and 4 tabs will not be affected.

My command buttons have the follwing codes:
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdBack_Click()
  2.     On Error Resume Next
  3.     DoCmd.GoToRecord , , acPrevious
  4. End Sub
  5.  
  6. Private Sub cmdFirst_Click()
  7.     On Error Resume Next
  8.     DoCmd.GoToRecord , , acFirst
  9. End Sub
  10.  
  11. Private Sub cmdLast_Click()
  12.     On Error Resume Next
  13.     DoCmd.GoToRecord , , acLast
  14. End Sub
  15.  
  16. Private Sub cmdNew_Click()
  17.     On Error Resume Next
  18.     DoCmd.GoToRecord , , acNewRec
  19. End Sub
  20.  
  21. Private Sub cmdNext_Click()
  22.     On Error Resume Next
  23.     DoCmd.GoToRecord , , acNext
  24. End Sub
To PhilOfWalton,
The last tab says No Longer Volunteer. It's just a title.
ijared
6 Hours Ago #14

NeoPa
Expert Mod 15k+
P: 30,842
IJared:
I want it to affect only the first 2 tabs so the 3 and 4 tabs will not be affected.
In that case convert the code to use the VBA objects rather than the DoCmd macro commands. It does mean you'll have to issue each command for both Pages though. There are no Tabs. Tab Controls have Pages, not Tabs.
As an example, your cmdFirst_Click code might look something like :
Expand|Select|Wrap|Line Numbers
  1. Private Sub cmdFirst_Click()
  2.     With Me
  3.         Call MoveRec(frmMe:=.{NameOfSubformOnTab1}.Form, strType:="First")
  4.         Call MoveRec(frmMe:=.{NameOfSubformOnTab2}.Form, strType:="First")
  5.     End With
  6. End Sub
  7.  
  8. Private Sub cmdLast_Click()
  9.     With Me
  10.         Call MoveRec(frmMe:=.{NameOfSubformOnTab1}.Form, strType:="Last")
  11.         Call MoveRec(frmMe:=.{NameOfSubformOnTab2}.Form, strType:="Last")
  12.     End With
  13. End Sub
  14.  
  15. ...
  16.  
  17. Private Sub MoveRec(frmMe As Form, strType As String)
  18.     With frmMe.Recordset
  19.         Select Case strType
  20.         Case "First"
  21.             Call .MoveFirst
  22.         Case "Last", "New"
  23.             Call .MoveLast
  24.             If strType = "New" Then Call .MoveNext
  25.         Case "Previous"
  26.             Call .MovePrevious
  27.         Case "Next"
  28.             Call .MoveNext
  29.     End With
  30. End Sub
This all assumes the forms are not related or linked.
3 Hours Ago #15

twinnyfo
Expert Mod 100+
P: 2,415
I do think the long pole in the tent is the records behind the tab control in the first place. Based on the description so far, the navigation controls on the form already affect all the pages in the tab control. If this is the case, then I don’t know how to change the record on pages 1 and 2, and maintain the same record on tabs 3 and 4. Wouldn’t this require a restructure of the tab control to include sub forms on each page?
2 Hours Ago #16

NeoPa
Expert Mod 15k+
P: 30,842
Probably. Hard to know unless we're told though.
2 Hours Ago #17

PhilOfWalton
Expert 100+
P: 1,183
I'm sorry ijared. Unless you use the correct terms we are going to struggle. You correctly refer to command buttons one moment, and then refer to them as tabs. Very confusing.

If you select a control with your cursor, you will find it's correct Selection Type in the properties window. Please ONLY use those terms.

Here are some images of forms, and those images in design view, I have indicated where to will find the correct type of control.

This is a Tab control.



This is a Page Control



In form view these are some of the form's components.



I suggest that you refer to the things at the bottom of your form as Navigation Command Buttons, and at the top of your form you have a Tab Control with four Pages on it.

Using the correct terms, I'm sure we can help

Phil
Attached Images
File Type: jpg Tab Control.jpg (92.3 KB, 2 views)
File Type: jpg page.jpg (73.1 KB, 2 views)
File Type: jpg Navigation.jpg (63.5 KB, 2 views)
23 Minutes Ago #18

Post your reply

Sign in to post your reply or Sign up for a free account.