A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do I adjust column width programatically in subform



 
 
Thread Tools Display Modes
  #1  
Old August 29th, 2007, 07:26 PM posted to microsoft.public.access.forms
Jeff Stroope
external usenet poster
 
Posts: 3
Default 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  
Old August 30th, 2007, 04:27 AM posted to microsoft.public.access.forms
UpRider
external usenet poster
 
Posts: 259
Default 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  
Old August 30th, 2007, 04:50 PM posted to microsoft.public.access.forms
Jeff Stroope
external usenet poster
 
Posts: 3
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:52 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.