Field view width in datasheet view wont save

jleval

Registered User.
Local time
Today, 16:09
Joined
May 16, 2012
Messages
53
Okay, this has frustrated me about access. Why cant i save the width I want in my subform in datasheet view. I dont want my customer to have to resize the form everytime he opens it.
I have placed the code within the on open and on load as follows:

Me.ToolNumber.ColumnWidth = -2
Me.SortBin.ColumnWidth = -2
Me.MeasPosition.ColumnWidth = -2
Me.NoAverages.ColumnWidth = -2
Me.DiaMax.ColumnWidth = -2
Me.DiaMin.ColumnWidth = -2
Me.DiaMean.ColumnWidth = -2
Me.TIR.ColumnWidth = -2
Me.TaperAngle.ColumnWidth = -2
Me.FrontDeltaTaperAngle.ColumnWidth = -2
Me.BackDeltaTaperAngle.ColumnWidth = -2

Yet, when I go through the records and the fields get larger, I get the ##########
Is there a way to ensure that the field size will change to the proper size.
PS. Please don't tell me to set the field size and save it because that just doesn't work-in any instance.
Thanks
 
When you say you've put it in the On Open and On Load event, did you mean the subform's event? Try using the main form's On Load event and you will need to refer to the subform control name (control on the main form which displays the subform):

Me.YourSubformControlNameHere.Form.ToolNumber.ColumnWidth = -2

etc.
 
Still having the same problem. The problem occurs in my subform when i switch to another record and the field size becomes larger
 
Still having the same problem. The problem occurs in my subform when i switch to another record and the field size becomes larger

Ah, okay. Call it from the ON CURRENT event instead.
 

Users who are viewing this thread

Back
Top Bottom