Navigation form sub bar height issue (1 Viewer)

choaspes

Registered User.
Local time
Today, 22:56
Joined
Mar 7, 2013
Messages
78
Hi All

My database front end is structured around a navigation form and each tab on the "main" navigation bar has its own selection of tabs on its respective "sub" navigation bar. For one of my "main" tabs I have a public sub that determines which of its "sub" tabs are visible in different situations (it also adjust the width and right padding of the invisible tabs so that the remaining tabs are always the same distance apart). Most of the time everything is hunky dory but when particular scenarios arise in which significantly fewer tabs are visible than usual the navigation sub bar increases in height by 110 twips, making the form look odd.

My assumption is that something about the formatting of the tabs is forcing the navigation bar to increase in height but no part of the code alters the height or the vertical padding of any tabs or the navigation bar. Dotting debug.prints through the code suggests that none of the tabs change height or padding at any stage of the procedure, they are the same after, during and before. The same debug.prints confirm that at the end of the procedure the height of navigation bar is 110 twips more than before, and I am unable to force it back down again in VBA, it stays 110 twips higher even when I've just told it not to be. Something must be forcing the increase in the bar height but I've run out of ideas as to what and I'd be very grateful for suggestions.

Thanks in advance
 

GPGeorge

George Hepworth
Local time
Today, 14:56
Joined
Nov 25, 2004
Messages
2,000
Maybe this would be easier to visualize with a pair of screen shots showing "before" and "after" status.
 

choaspes

Registered User.
Local time
Today, 22:56
Joined
Mar 7, 2013
Messages
78
Thanks George, here they are. White bits contained info that needed to be redacted. You'll see in the "after shot" that the spacing of the tabs seems to be different and the navigation subform has been pushed down 110 twips. The only value that I can identify as having changed is the height of the second row of tabs.

[Pictures redacted after finding 'solution' ...or at least a workaround]
 
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 05:56
Joined
May 7, 2009
Messages
19,246
why not "show" all the tabs (buttons) and just Disable those that are not needed.
 

choaspes

Registered User.
Local time
Today, 22:56
Joined
Mar 7, 2013
Messages
78
why not "show" all the tabs (buttons) and just Disable those that are not needed.
Because there are far too many to fit, and for most of those tabs there are in fact two tabs for different situations but those tabs are designed to look the same to the user. That means that dependent on the situation the sub is making about half of the tabs width 0, right padding 0 and invisible and the other half width whatever, right padding whatever and visible.
 

choaspes

Registered User.
Local time
Today, 22:56
Joined
Mar 7, 2013
Messages
78
An update. I didn't manage to solve the problem but I took arnelgp's suggestion of using the .enabled property and adapted the sub to keep more tabs visible but disenable some of them, and for whatever reason keeping more tabs on the screen means the navigating sub-bar no longer resizes itself. Thanks both.
 

choaspes

Registered User.
Local time
Today, 22:56
Joined
Mar 7, 2013
Messages
78
I have finally, finally, finally found a proper workaround for this. My temporary workaround above didn't survive first contact with real life and unfortunately in various scenarios my navigation sub-bar still grew without invitation and made my form look rubbish.

I still have no idea why the form is behaving as it does but I've significantly narrowed down what it's doing and when it's doing it. The saved state of the form has about half of the tabs visible and the rest invisible and width zero. Changing the width or the visibility status of the initially invisible tabs in isolation doesn't seem to affect the of the height of the bar. What does effect the bar height is reducing with the width of tabs that were initially visible and non-zero width, reducing a little has a small effect but when you get down to 50 twips and below the bar height increases dramatically.

The reason the height of the navigation bar increases is that the bottom (and at very low widths also the top) padding of the tab increases as its width approaches zero. I have no idea why or how to stop it doing this, but what it does mean is that I can undo the damage at the end of the sub by taking the tab top and bottom padding, and the bar height, at the start of the sub then resetting the tab padding to those values at the end of the sub - which allows me to also reduce the nav sub-bar height back to its original value.

I hope that this post prevents someone somewhere going through what I've been going through the last few weeks.
 

isladogs

MVP / VIP
Local time
Today, 22:56
Joined
Jan 14, 2017
Messages
18,258
Congratulations on finding a 'solution' ...or at least a workaround
Can I suggest you restore the screenshots to post #3 as they may help others understand the issue better in future
 

choaspes

Registered User.
Local time
Today, 22:56
Joined
Mar 7, 2013
Messages
78
Congratulations on finding a 'solution' ...or at least a workaround
Can I suggest you restore the screenshots to post #3 as they may help others understand the issue better in future
I would rather not, but I will defer to you on the language that best describes my 'achievement'
 

isladogs

MVP / VIP
Local time
Today, 22:56
Joined
Jan 14, 2017
Messages
18,258
I hadn't seen this thread before today so all I know is what you've written...and I'm unsure what it means.
The screenshots must have been worth posting originally. It just seems odd to remove them now.
 

Users who are viewing this thread

Top Bottom