Solved

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

Posted on 2013-11-21
21
441 Views
Last Modified: 2014-01-04
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. Mutli Row Tab Control Truncates Tab InfoDeleted by _alias99, 500 points refunded. - 12/8/2013 7:13:43 AM
RA: http://www.experts-exchange.com/R_26086.html
0
Comment
Question by:askolits
  • 9
  • 4
  • 2
  • +4
21 Comments
 
LVL 24

Expert Comment

by:chaau
ID: 39668101
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
0
 

Author Comment

by:askolits
ID: 39668122
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' Contents of tab moved 'foward' of tab
I'll have to get back on this next week, so if I don't respond to any post, I will next week.

John
0
 
LVL 61

Expert Comment

by:mbizup
ID: 39668143
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.
>>
0
 
LVL 30

Expert Comment

by:hnasr
ID: 39668592
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.
0
 

Author Comment

by:askolits
ID: 39668756
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.
0
 
LVL 45

Expert Comment

by:aikimark
ID: 39669823
Are your controls placed directly on each tab?  You might need to create a frame into which to place the controls.
0
 

Author Comment

by:askolits
ID: 39669875
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.
0
 
LVL 45

Expert Comment

by:aikimark
ID: 39669939
The sample I uploaded will show you what I did.
I don't see an 'example'.  To what upload do you refer?
0
 

Author Comment

by:askolits
ID: 39669970
Gee, I though I uploaded it. I will try again.
TabIssue.mdb
0
 
LVL 45

Expert Comment

by:aikimark
ID: 39670254
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.
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 30

Expert Comment

by:hnasr
ID: 39670304
Unable to see the issue.
What to look for?
But looks like aikimark is understanding. So I leave you with him
0
 
LVL 45

Expert Comment

by:aikimark
ID: 39670370
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.
0
 

Author Comment

by:askolits
ID: 39670390
@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.
0
 

Author Comment

by:askolits
ID: 39670399
@ 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.
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 39670809
try this, open form  revisedForm1
TabIssue.mdb
0
 

Author Comment

by:askolits
ID: 39674521
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.  Multi Rows in Tab ControlAccessMultiRowTabControlIssue3.jpg
0
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 39674564
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.
0
 

Accepted Solution

by:
askolits earned 0 total points
ID: 39674599
@Capricorn
Thanks for the idea. Yet, the method I came up with  (adjusting the font based on the number of characters in all the 'visible tab pages), is the best solution  so far.

But, still waiting on the rowcount property solution, I just posted the question to MSDN. Let's see what they come up with.

Thanks!
0
 

Author Comment

by:askolits
ID: 39690018
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
0
 
LVL 45

Expert Comment

by:Martin Liss
ID: 39755833
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now