Hi, My text box is set to grow. Does anyone know how I can adjust the label height to the height of the text box so the borders line up when printing. Thanks in advance
Hi, My text box is set to grow. Does anyone know how I can adjust the label height to the height of the text box so the borders line up when printing. Thanks in advance
in the report onformat event for the relevant section, try putting
myLabel.height=mytextbox.height
Thanks but no this doesn't work
read this post
http://www.access-programmers.co.uk/...d.php?t=162177
'doesn't work' doesn't help me to help you. did you step through the code? if so, what happened?
in the on Format event my code reads:
me.label.height = me.textbox.height
The problem is the height of the control is 1085mm but when I step throught the code is is trying to make the control 1050mm and I am not sure where this measurement is coming from.
I moved the code to the on Print event and when I step through the code it is the height is correct but it gives me an error that says the height of the control can't be altered once printing has started.
the code does needs to be in the format event (for the relevant section), not the print event, although I guess you could try the current event. You have two controls (label and textbox) which one are you referring to as being 1085mm (I presume you mean twips). If it is the textbox - what is the height of it in the design window? i.e. before you start to format
The height of the text box is 1085 twips in the design window. I tried the on current event but it does step into the code at all. Thanks anyway, I have tried everything I can think of - maybe it can't be done?
umm, no, I've done some more research and the resizing that happens from cangrow/shrink doesn't occur until the print event - at which point resizing of other controls is not allowedmaybe it can't be done?
So final chance - take a look at this link http://www.lebans.com/textwidth-height.htm
I've used a modified version of this code to be able to place images in text so I know it works.
Alternatively, remove the border from you label - perhaps use an underlined font instead
Thanks for your help, Ill look at your example