Automatic Datasheet Columns Width

Bunga2017

Registered User.
Local time
Today, 13:15
Joined
Mar 24, 2017
Messages
19
Please help, I set the new columns width in Datasheet view, then I save and close it. but after re-open the Form in Datasheet mode, the columns width (all columns) returned to previous amount !!
What is the solution (with VBA Code Access 2010)
for set "ALL columns width"
in "Best Fit"
due to load a form
(especially in datasheet view)??

Many thank you
 
datasheet view uses different properties. For continuous forms you make use of the control width property. In datasheet view it is the control columnwidth property.

for datasheets, in the form load event use the following code

Code:
dim ctrl as control
for each ctrl in me.controls
    on error resume next 'control does not have a columns width property, so move on
    ctrl.columnwidth=-2 '-2 equivalent to double clicking on the column header right edge
next ctrl

not sure what you mean by 'best fit'.
 
Wat I Mean about " Best Fit " is zie attachments !
 

Attachments

  • Best Fit.JPG
    Best Fit.JPG
    28.2 KB · Views: 368
I don't have that version of access. Suspect it is the same thing I was suggesting. Try it and see
 

Users who are viewing this thread

Back
Top Bottom