Link to home
Start Free TrialLog in
Avatar of askolits
askolits

asked on

Retrieve the displayed 'Row Count' in a Access Tab Control

I have an issue where I have controls  within a tab of a tab control that has 30 tabs.

If I show 'all' the tabs (with MultiRow = True), there are so many tab rows displayed, that the info within the tabs are visually truncated.  Just not enough real-estate.

One solution would be to check the RowCount property of the tab control and programmatically adjust the location of items within the  tabs accordingly.

In order do to that, I need the RowCount. It looks like in VB.Net, the tab control's rowcount property is exposed, but not within Access. Anyone know how to get that info.

Here is a snap shot. User generated imageDeleted by _alias99, 500 points refunded. - 12/8/2013 7:13:43 AM
RA: https://www.experts-exchange.com/R_26086.html
Avatar of chaau
chaau
Flag of Australia image

Have you tried playing with Vertical Anchor of the controls inside the tab pages. I just think it is wrong that the tops getting cut off instead of the hole page content pushing down.

Can you check if you could change the anchor values and see it it makes any difference
Avatar of askolits
askolits

ASKER

I just tried a bunch of things with the anchor settings but no change.  I just noticed that it really acts strange when it cuts off the top. If I click within the control, the tab contents move 'forward' and the tabs move 'back', visually.

Then when I move my mouse over the tabs they move 'forward'

Here's a pic with the contents of the tab moved 'forward' User generated image
I'll have to get back on this next week, so if I don't respond to any post, I will next week.

John
30 tabs is an awful lot.  I'd suggest taking a thorough look at your form's design, especially if those tabs contain a lot of controls, and possibly moving logically grouped tabs to separate forms... for ease of use and for performance reasons.

Tips for improving form performance:
http://www.fmsinc.com/microsoftAccess/Performance.html#Forms

<<
Minimize the number of controls on your form. Loading controls is the biggest performance hit when loading a form.
>>
As mbizup suggested, you may need to modify the design.

In the mean time it may be helpful to solve the current issue to not delay your work.

Upload a sample database avoiding private data. Explain what to do to reproduce the issue and what to expect.
Well, modifying the control design and layout is really not an option.  Yet, by reproducing the problem with a basic form, showed me a few things.  (See attached)

While changing the 'caption' during design mode, the height of the tab control adjust accordingly. Then there is no issue. But, if the captions are made short, and then while in form view, you modify the captions to longer lengths, problems occur.

Also if the tab control is 'not'  at the top of the form section (i.e. detail section), the tab control will grow upwards to compensate the growing tab control rows. But if the tab control is pushed up to the top of the section, it has no where to grow. So, the rows grow downward covering over the contents of the tab.

I also noticed that after the tab names are increased (on the example's right tab control), the height of that control changes and doesn't revert back when the caption are made smaller. Also the text control, within the tab, is repositioned.

Now regardless of how this all works, I would still like to know if anyone knows how to get the row count of the control.
Are your controls placed directly on each tab?  You might need to create a frame into which to place the controls.
Not sure exactly what you mean by 'directly' . But, the controls are within in each tab.

The sample I uploaded will show you what I did.
The sample I uploaded will show you what I did.
I don't see an 'example'.  To what upload do you refer?
Gee, I though I uploaded it. I will try again.
TabIssue.mdb
I understand now.  If you limit the length of the tab captions so that you don't have more than three rows of tabs, it behaves well.

Alternatively, you could make the tab control wider when you lengthened the tab captions.
Unable to see the issue.
What to look for?
But looks like aikimark is understanding. So I leave you with him
You could change the style so that neither tabs nor buttons are displayed and add a combobox control that can accommodate longer text strings without consuming vertical real estate.  The selection of a combobox item would be coded to show the associated tab/page.
@aikimark  Actually already considered those ideas and I already have a limit on the number of characters. (20)  Widening the TabControl is not an option.

This is was I've done so far:

I ran all the tabs caption's to their max width of 20 characters with "XXXX..." and made all tabs visible.  I then totaled the number of characters of all the tabs. (Which should be 30 tabs X 20 characters = 600)  Actually, I have I have one extra tab that the user can't change.  so total is 630 characters.

I then looked at how many rows were created. I think it was 8. But I only want a max of 6 rows. 6 rows will prevent the visual overlap.  So, I then change the font size of the tab control based on the total number of characters. With all tabs on and 630 characters, I can set the font size to 6 and get only 6 rows.  I then do an if/then statement to change the font to different sizes based on the number of characters. That way I can control the number of rows.

It's not the perfect fix because a 6 font is pretty small. But it's a start. Yet, it would be easier for me if I could get the control's row count.
@ aikimark
Can't use the Combo box suggestion. The user needs to see the actual tabs. It's part of the design and an important feature.
try this, open form  revisedForm1
TabIssue.mdb
An interesting idea.  But, I still need to retain the ability to have multiple tabs in a row. I can see where you thought from my example that having all the tabs in their own row might be a solution. But, that won't work for me. It still needs to be dynamic. The length of the each tab caption will be different. The below pic provides a different example. In this one, I just made the tab names a bit different in length.  User generated imageAccessMultiRowTabControlIssue3.jpg
oh well, then i think the only way to do this is to make your TabControl height tall enough to accommodate the Tabs without interferring with the controls inside the Pages.
ASKER CERTIFIED SOLUTION
Avatar of askolits
askolits

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Well, the MS people really feel there is no way to get the RowCount property. I'll use my Character count method to adjust my rows as needed.

Moderator: Not sure if you want to just delete this or mark my solution as the answer. It's up to you. My solution works for me but not necessarily the solution to the original question.  You're call.

Thanks,

John
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.