UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Move Label In Group Header That Grows, Access 2016    
 
   
doctor9
post Feb 19 2018, 09:59 AM
Post#1


Remembered
Posts: 18,324
Joined: 29-March 05
From: Wisconsin


I have a label that is acting as a column header, and it's located in the group header GroupHeader0. I have the label positioned at the bottom of the group header in Design View, but since the group header can grow, the label ends up positioned about halfway down the header's height, floating way above the column of data it's supposed to be acting as the header for.

What sort of VBA can I use to detect the group header's new height, and adjust the label's vertical position so it's back at the bottom of the header again?

I tried this in the group header's Format event:
CODE
    Me.lblEmployeeName.Top = Me.GroupHeader0.Height - Me.lblEmployeeName.Height


But I got this error:
QUOTE
Run-time error '2101':
The setting you entered isn't valid for this property.

Which makes me think that I'm going about it the wrong way.

Dennis

--------------------
(;,;) Li'l Cthulu says: Please talk about what you're trying to do, as well as how you're doing it.
Changing your real table name to "Table1" and your real form name to "Form1" in your posts makes it more difficult to understand what's going on, not easier.
Guidelines for Posting Questions
Go to the top of the page
 
theDBguy
post Feb 19 2018, 10:26 AM
Post#2


Access Wiki and Forums Moderator
Posts: 73,245
Joined: 19-June 07
From: SunnySandyEggo


Hi Dennis,

What specifically is making the Group Header grow? Try placing the label below it (just for testing).

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
doctor9
post Feb 19 2018, 10:31 AM
Post#3


Remembered
Posts: 18,324
Joined: 29-March 05
From: Wisconsin


There's a subreport in the group header, which is a horizontal list of test names. In other words, the text is sideways, and depending on the test category being printed, the test names subreport has different heights. I'd like, if possible to have the label and the subreport to be aligned along their bottom edges because they are BOTH column headers; one for the employee name and the list of tests, which is why I'd rather re-position the label rather than have it below the subreport.

Hope this helps,

Dennis
Attached File(s)
Attached File  LabelMove.jpg ( 102.79K )Number of downloads: 8
 

--------------------
(;,;) Li'l Cthulu says: Please talk about what you're trying to do, as well as how you're doing it.
Changing your real table name to "Table1" and your real form name to "Form1" in your posts makes it more difficult to understand what's going on, not easier.
Guidelines for Posting Questions
Go to the top of the page
 
theDBguy
post Feb 19 2018, 10:33 AM
Post#4


Access Wiki and Forums Moderator
Posts: 73,245
Joined: 19-June 07
From: SunnySandyEggo


Hi,

I understand what you wanted but just asking to troubleshoot an idea I might have for aligning the two controls. For example, if you succeed in moving the label, then perhaps you can duplicate the subform, but hide it, just above the label.

Just thinking out loud...

--------------------
Just my 2 cents... "And if I claim to be a wise man, it surely means that I don't know" - Kansas
Access Website | Access Blog | Email
Go to the top of the page
 
pere_de_chipstic...
post Feb 19 2018, 05:45 PM
Post#5


UtterAccess Editor
Posts: 10,271
Joined: 8-November 07
From: South coast, England


Hi Dennis

Try the Groups Header's On Retreat event.

HTH


--------------------
Warm regards
Bernie
Go to the top of the page
 
doctor9
post Feb 19 2018, 05:54 PM
Post#6


Remembered
Posts: 18,324
Joined: 29-March 05
From: Wisconsin


Bernie,

Thanks for the suggestion; no error, but the event doesn't fire when you go into Print Preview, or when you actually Print. Not really clear on when that's supposed to fire, but apparently this report doesn't "retreat". :-/

I've also tried placing a thin unbound textbox just below the subreport, with the Employee Name label attached to that textbox. However, the textbox gets pushed down while leaving it's attached label behind. Very odd.

At this point, I've made the test name label as wide as the widest label and fixed it that way. I have a lot of white space, but at least the employee name label is aligned at the bottom like I want it. I'm just thinking that the original error message is telling me that I have the wrong syntax.

Dennis

--------------------
(;,;) Li'l Cthulu says: Please talk about what you're trying to do, as well as how you're doing it.
Changing your real table name to "Table1" and your real form name to "Form1" in your posts makes it more difficult to understand what's going on, not easier.
Guidelines for Posting Questions
Go to the top of the page
 
pere_de_chipstic...
post Feb 19 2018, 06:01 PM
Post#7


UtterAccess Editor
Posts: 10,271
Joined: 8-November 07
From: South coast, England


Dennis,

that's odd, I've tried it in a couple of my reports and it works. Try the code in the Detail Format event, and probably any section after the relevant header section - the code has to fire afterthe group header has grown!

--------------------
Warm regards
Bernie
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    22nd September 2018 - 12:26 AM