If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
How do I adjust column width programatically in subform
Hi,
I have a subform on my main form that is a datasheet view of a query. The subform has 1 column. When the main form opens, the subform column does not completely fill the width of the subform control. If I go to the right edge of the column heading and double click, the column auto fits to the width of the subform window. Is there any way to do this programatically when the form opens? -- Thanks, Jeff |
#2
|
|||
|
|||
How do I adjust column width programatically in subform
Jeff, I don't know how to permanently stretch the column width, but here's
code to make the columns as wide as necessary for the data it contains. It also keeps the user from collapsing a column to zero width. This code is for 3 columns. Documentation *says* columwidth can be set directly in twips, but I couldn't get that to work. Private Sub Form_Current() Me.dueCompDate.ColumnHidden = False Me.dueDate.ColumnHidden = False Me.dueTask.ColumnHidden = False Me.dueCompDate.ColumnWidth = -2 Me.dueDate.ColumnWidth = -2 Me.dueTask.ColumnWidth = -2 End Sub UpRider "Jeff Stroope" wrote in message ... Hi, I have a subform on my main form that is a datasheet view of a query. The subform has 1 column. When the main form opens, the subform column does not completely fill the width of the subform control. If I go to the right edge of the column heading and double click, the column auto fits to the width of the subform window. Is there any way to do this programatically when the form opens? -- Thanks, Jeff |
#3
|
|||
|
|||
How do I adjust column width programatically in subform
Thanks!
-- Thanks, Jeff "UpRider" wrote: Jeff, I don't know how to permanently stretch the column width, but here's code to make the columns as wide as necessary for the data it contains. It also keeps the user from collapsing a column to zero width. This code is for 3 columns. Documentation *says* columwidth can be set directly in twips, but I couldn't get that to work. Private Sub Form_Current() Me.dueCompDate.ColumnHidden = False Me.dueDate.ColumnHidden = False Me.dueTask.ColumnHidden = False Me.dueCompDate.ColumnWidth = -2 Me.dueDate.ColumnWidth = -2 Me.dueTask.ColumnWidth = -2 End Sub UpRider "Jeff Stroope" wrote in message ... Hi, I have a subform on my main form that is a datasheet view of a query. The subform has 1 column. When the main form opens, the subform column does not completely fill the width of the subform control. If I go to the right edge of the column heading and double click, the column auto fits to the width of the subform window. Is there any way to do this programatically when the form opens? -- Thanks, Jeff |
Thread Tools | |
Display Modes | |
|
|