Results 1 to 8 of 8
  1. #1
    oxicottin is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2007
    Posts
    8

    Change Height of Box to height of textBox

    Hello, I have been fiddleing around with this all day and cant seem to get it to work correctly. I have a report that has various controls throughout the detail section and one text box in that section can grow. Well in this section with the text box that can grow there is a box around that section and this box is slightly larger in height so it boxes in all the text boxes/controls in that section. I need the box (bxSpecialInstructions) to grow in height when the text box (txtSpecialInstructions) grows BUT always stay slightly taller. I tried the VBA below and it works but the Box isn't constant in its height but always stays taller. How can I get it to work properly? Thanks!



    Code:
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
     Me.bxSpecialInstructions.Height = Me.txtSpecialInstructions.Height + 12 * Len(Me.txtSpecialInstructions)
    End Sub
    Attached Files Attached Files

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    What do you mean by 'constant in its height'? You mean the box remains the height for all records as set by the first record? This is expected because changing the properties of a control changes for all instances of the control.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    oxicottin is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2007
    Posts
    8
    In my attachment it does show you exactly what im trying to achieve... What im looking to do is have the box (bxSpecialInstructions) slightly larger in height than the textbox (txtSpecialInstructions) and as the textbox grows in height the Box does also in height but yet still stays that slightly larger aspect.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    I explained in my previous post why the height does not change for each record. I don't know any method to dynamically adjust control properties for each record in a continuous record output. I have tried and it just doesn't work.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    oxicottin is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2007
    Posts
    8
    What do you mean continuous record output? This is a report just like the example I attached in my inital post. Please have a look because I think were on two different pages.... Thanks!

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    That report is what I mean by 'continuous'. Multiple records displayed in the detail section. As opposed to opening the report filtered to just one record.

    Changing the box design property will cause it to display with that setting for ALL records. The event runs just once so that property is set based on the first record and stays that way for the remainder.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    oxicottin is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2007
    Posts
    8
    Ok I figured a work around then without VBA. Change the margins ect and it works great.
    Attached Files Attached Files

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,633
    Glad you found a solution. It is definitely working although I can't see why. What do you mean by 'change the margins etc'?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 4
    Last Post: 09-15-2012, 07:31 PM
  2. Auto Adjusting Field Height
    By cphelps48 in forum Reports
    Replies: 1
    Last Post: 11-29-2011, 11:53 PM
  3. How to reduce ribbon height
    By alaric01 in forum Access
    Replies: 2
    Last Post: 11-09-2010, 08:38 AM
  4. Field output for height?
    By emccalment in forum Access
    Replies: 1
    Last Post: 01-29-2010, 12:42 PM
  5. set continuous form height
    By taylorosso in forum Forms
    Replies: 0
    Last Post: 08-31-2009, 05:26 AM

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