Results 1 to 10 of 10
  1. #1
    Kylie is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2015
    Posts
    7

    Label Heights

    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

  2. #2
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    in the report onformat event for the relevant section, try putting

    myLabel.height=mytextbox.height

  3. #3
    Kylie is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2015
    Posts
    7
    Thanks but no this doesn't work

  4. #4
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,372

  5. #5
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    'doesn't work' doesn't help me to help you. did you step through the code? if so, what happened?

  6. #6
    Kylie is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2015
    Posts
    7
    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.

  7. #7
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    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

  8. #8
    Kylie is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2015
    Posts
    7
    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?

  9. #9
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    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 allowed

    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

  10. #10
    Kylie is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2015
    Posts
    7
    Thanks for your help, Ill look at your example

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 04-25-2014, 11:41 AM
  2. Report with varying row heights
    By AKWells in forum Reports
    Replies: 7
    Last Post: 04-24-2014, 10:48 AM
  3. Label Help
    By rcotero in forum Access
    Replies: 2
    Last Post: 11-05-2010, 01:39 PM
  4. Formatting a label
    By swicklund in forum Reports
    Replies: 4
    Last Post: 08-24-2010, 03:27 PM
  5. Replies: 2
    Last Post: 06-18-2006, 10:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums