Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2013-11-21
21
Medium Priority
?
472 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
20 Comments
 
LVL 25

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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 31

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 46

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 46

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 46

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
 
LVL 31

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 46

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 120

Expert Comment

by:Rey Obrero (Capricorn1)
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 120

Expert Comment

by:Rey Obrero (Capricorn1)
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 49

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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

876 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