Tab Control page not sticking to record

  • Thread starter NoLegalMoves via AccessMonster.com
  • Start date
N

NoLegalMoves via AccessMonster.com

In my form I have a tab control with 10 pages.
For each record 1 tab is selected only and filled out.
I would like the form to "remember" which tab is filled out and display it
everytime the record is changed.
Currently the only tab selected is the one I click on. I would like the tab
to change automatically for each record.

Thanks for the help

Jeff
 
M

Mr. B

Using VBA code it is quite possible to display a specific tab when the record
changes. However, I just do not feel that I have enough information to help
you very much on just exactly how you might go about getting it done.

It sounds like you may have a different set of data that would be completed
for any one specific record. If this is the case, you can use code in the On
Current event of your form to determine which fields are populated and then
display the appropriate tab based on that information.

If you care to post back with a little more detail, perhaps we can be of
more specific assistance.
 
J

jfsauzeat129 via AccessMonster.com

Thanks for the response.
Sorry I wasnt more clear. I will try to be more specific

My form (Form A) is feeding the TableA
The Form A has a number of fields (all included in Table A) which are divided
onto different tabs of the tab control A.
Ex: Tab 1 has the frame1 and text1
Tab 2 has field frame 2 and text2

As an example, for the 1st record, if information was entered in frame 2 and
/or text 2 and no information entered in any of the fields of tab 1, the tab
displayed when I navigate to this record should be tab 2.

Since I actually have 10 tabs and a lot of fields, the code sounds
complicated.

Can you help?

Thank you

Jeff


Mr. B said:
Using VBA code it is quite possible to display a specific tab when the record
changes. However, I just do not feel that I have enough information to help
you very much on just exactly how you might go about getting it done.

It sounds like you may have a different set of data that would be completed
for any one specific record. If this is the case, you can use code in the On
Current event of your form to determine which fields are populated and then
display the appropriate tab based on that information.

If you care to post back with a little more detail, perhaps we can be of
more specific assistance.

----
HTH
Mr. B
askdoctoraccess dot com
In my form I have a tab control with 10 pages.
For each record 1 tab is selected only and filled out.
[quoted text clipped - 6 lines]
 
M

Mr. B

Jeff,

The code would not be that complicated. You could use an "If" and "ElseIF"
statements to check for the values you need to find in order to display a
specific tab.

If Frame1 = SomeValue or not isnull(me.text1) then
'show the desired tab
Me.tabCtrl.Pages(0).SetFocus
ElseIf Frame2 = SomeValue or not isnull(me.text2) then
'show the desired tab
Me.tabCtrl.Pages(1).SetFocus
ElseIf
'add additional ElseIf Statements as needed like above
EndIf

If you do not want to do it like that, you could create a field in your
table that you could store the name of the tab where data was entered. You
would need to use code to update this field each time the user complete data
entry.

Just my thoughts on the issue.

----
HTH
Mr. B
askdoctoraccess dot com


jfsauzeat129 via AccessMonster.com said:
Thanks for the response.
Sorry I wasnt more clear. I will try to be more specific

My form (Form A) is feeding the TableA
The Form A has a number of fields (all included in Table A) which are divided
onto different tabs of the tab control A.
Ex: Tab 1 has the frame1 and text1
Tab 2 has field frame 2 and text2

As an example, for the 1st record, if information was entered in frame 2 and
/or text 2 and no information entered in any of the fields of tab 1, the tab
displayed when I navigate to this record should be tab 2.

Since I actually have 10 tabs and a lot of fields, the code sounds
complicated.

Can you help?

Thank you

Jeff


Mr. B said:
Using VBA code it is quite possible to display a specific tab when the record
changes. However, I just do not feel that I have enough information to help
you very much on just exactly how you might go about getting it done.

It sounds like you may have a different set of data that would be completed
for any one specific record. If this is the case, you can use code in the On
Current event of your form to determine which fields are populated and then
display the appropriate tab based on that information.

If you care to post back with a little more detail, perhaps we can be of
more specific assistance.

----
HTH
Mr. B
askdoctoraccess dot com
In my form I have a tab control with 10 pages.
For each record 1 tab is selected only and filled out.
[quoted text clipped - 6 lines]
 
J

jfsauzeat129 via AccessMonster.com

Thanks for your help.
I will try to work out the code for the second idea..
Implementing the tests is just going to be too much work since there are 10
tabs and about 10 fields per tab.

Thanks for you time and advice.

Jeff

Mr. B said:
Jeff,

The code would not be that complicated. You could use an "If" and "ElseIF"
statements to check for the values you need to find in order to display a
specific tab.

If Frame1 = SomeValue or not isnull(me.text1) then
'show the desired tab
Me.tabCtrl.Pages(0).SetFocus
ElseIf Frame2 = SomeValue or not isnull(me.text2) then
'show the desired tab
Me.tabCtrl.Pages(1).SetFocus
ElseIf
'add additional ElseIf Statements as needed like above
EndIf

If you do not want to do it like that, you could create a field in your
table that you could store the name of the tab where data was entered. You
would need to use code to update this field each time the user complete data
entry.

Just my thoughts on the issue.

----
HTH
Mr. B
askdoctoraccess dot com
Thanks for the response.
Sorry I wasnt more clear. I will try to be more specific
[quoted text clipped - 40 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top