Solved Match the Label height with the text box in a report and print (1 Viewer)

Sodslaw

Registered User.
Local time
Today, 02:19
Joined
Jun 7, 2017
Messages
81
Searched and found a solution for this issue but for some reason its not working for me.

Code im using...

Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.LblNotes.Height = Me.Notes.Height
End Sub
Results....
1648032890049.png

BTW the Text box "can grow"

Any idea why the label isnt growing? thanks in advance.

i just added a msgbox to see the height of both label and txtbox

Code:
MsgBox "Notes Height= " & Me.Notes.Height & "  Lbl Height= " & Me.LblNotes.Height

1648034001506.png
 
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 17:19
Joined
May 7, 2009
Messages
19,169
on report design view, select the textbox and the label.
on ribbon->arrange->stacked.

no need to add code to the format event of the detail section.
 

Sodslaw

Registered User.
Local time
Today, 02:19
Joined
Jun 7, 2017
Messages
81
1648034696903.png


1648034773024.png
 

Sodslaw

Registered User.
Local time
Today, 02:19
Joined
Jun 7, 2017
Messages
81
Same result.
intresingly if i remove the label and add another txtbox and give it a value then it works.
ie
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.Lbltxt.value = "NOTES:"
Me.Lbltxt.Height = Me.Notes.Height
End Sub

1648035534664.png


i think that will do. but its intresting...... :(
 

Sodslaw

Registered User.
Local time
Today, 02:19
Joined
Jun 7, 2017
Messages
81
@arnelgp BTW if i remove the stacked function, then it doesnt work again. So, without knowing to implement the stacked function i wouldnt have solved it ..... many thanks mate, great Job!
 

Users who are viewing this thread

Top Bottom