Setting SubForm Datasheet Colum Widths

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a Form with a SubForm on it set to Datasheet View.

I would like to be able to programmtically set the Column Widths of each
column so that when the Form opens they are set to certain withds, or ideally
a "Fit To" Width, that is
wide enough so all data shows, so user does not have to Expand the width
manually.

I tried the following:

In the Main Form Load Event..

Private Sub Form_Load()
Form_subfrmPaymentMethods.txtPaymentMethod.Width = 1440
End Sub


I also tried in the SubForm Load Event...

Private Sub Form_Load()
txtPaymentMethod.Width = 1440
End Sub


Neither works. It just retains the previous width from what user set.

Any help would be greatly appreciated.

Thank you,
Jeff
(e-mail address removed)
 
Yes! Once you use Datasheets you lose a lot of control. It would be nice to
be able to control the widths & column order.
 
Here is a previous post of mine on this subject.

From: Stephen Lebans
([email protected])
Subject: Re: Freeze Column?
View: Complete Thread (3 articles)
Original Format
Newsgroups: microsoft.public.access.forms,
microsoft.public.access.formscoding,
Date: 2003-12-24 11:53:00 PST

For programmatic control for forms in Datasheet view my standard
response is:

1) Michael Kaplan has an excellent article on manipulating Datasheets
here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsmart
01/html/sa01b1.asp

2) An API solution is here:
http://www.lebans.com/autocolumnwidth.htm
The AutoSizing project also contains a method to FREEZE the
ColumnWidths.


--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
 
Back
Top