Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resize text box row heights on continuous form

Status
Not open for further replies.

Hfnet

IS-IT--Management
Joined
Dec 31, 2003
Messages
369
Location
GB
I have a continuous form and I want to be able to resize all rowheights for all textboxes on the form. I have done this with code for each text box which works but is long in vba code, but I wondered if there was a simple procedure to increase rowheight and fontsize on command button and reduce it on another command button? My boss complains he can't read 10 point on his 17" tft!!
 
don't think so...

but you could just do a loop through all the controls on the form, and alter the fontsize/height of the relevant controls...

you could even put this in a module, and make it a generic function so you can call it for any form...

--------------------
Procrastinate Now!
 
elaborating on the suggestion, you can even apply the function to the particular form section, thus ONLY do the items (controls) in the Detail section. and even filter it to ONLY do specific control types.




MichaelRed


 
How are ya Hfnet . . . . .

Add a checkMark ([blue]?[/blue]) to the [blue]Tag[/blue] property of all the textboxes of interest (you can group select and enter once). The tags allow you to discriminate in case other controls are not to be included. Then call the following routine supplying the newheight:
Code:
[blue]Public Sub SetHeight([purple]NewHeight[/purple] As Long)
   [green]'NewHeight is in inches![/green]
   Dim ctl As Control
   
   For Each ctl In Me.Controls
      If ctl.Tag = "[purple][b]?[/b][/purple]" Then
         ctl.Height = 1440 * NewHeight
      End If
   Next

End Sub[/blue]
Be aware: For sizing, VBA uses a uit of measure called [blue]Twips[/blue]. One Twip = 1/1440 inch . . . therefore:

Twips = 1440 * inches

Calvin.gif
See Ya! . . . . . .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top