Results 1 to 6 of 6
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is online now Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    2,096

    Change properties of a text box

    I have a multipurpose report where I'd like to change the font size and textbox height under certain conditions. In changing the height of the textbox, I would also need to increase the height of the Detail section. Assuming this can be done, I also need to READ the current values so that I can restore them before exiting the report, UNLESS they automatically revert when the report closes.

    I don't see the options I need when coding Me.MyTextBox.

    Can I change these textbox properties in code?

    Thanks,


    Bill

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Maybe. Try code in the Detail section Format event. However, that event triggers only for PrintPreview.
    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
    GraeagleBill's Avatar
    GraeagleBill is online now Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    2,096
    June,
    It turns out that even though the "auto-fill" list given by the VBA editor doesn't list all properties of a control, it is valid to code them.

    Code:
             ' Since the printed posting will be viewed by many seniors, we're going to
             ' increase the size of the text to a size more appropriate.  The changes to
             ' the controls are not permanent, so it's not necessary to restore the design
             ' values.  All the values used here are in direct proportion to the overall
             ' design.  The desired "inch" values are entered in twips.
             Me.tbName.Height = 400
             Me.tbName.Width = 5340
             Me.tbName.FontSize = 18
             Me.Detail.Height = 500
    Thanks,
    Bill

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Which properties are not listing? I get all 4 that you show in the code.
    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
    GraeagleBill's Avatar
    GraeagleBill is online now Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    2,096
    With A2003, I don't get properties listed for:


    Me.tbName.Height = 400 Me.tbName.Width = 5340 Me.tbName.FontSize = 18

    I do get "Height" listed for Me.Detail.

    Bill

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Oh, okay, been a while since I worked with 2003.
    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: 7
    Last Post: 04-23-2013, 11:57 AM
  2. Text box change color
    By Ray67 in forum Forms
    Replies: 14
    Last Post: 11-19-2012, 04:06 PM
  3. Replies: 6
    Last Post: 11-14-2012, 01:06 PM
  4. Replies: 7
    Last Post: 10-04-2012, 01:30 PM
  5. Replies: 5
    Last Post: 06-23-2012, 04:30 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