newfrontiers:
I know that this does'nt really answer your question, but why not let the user change the column widths, but force the form to always open with defined widths settings by putting code, similar to that supplied by the above post, in the OnOpen event of the form.
jobo123:
John, why not create just a single routine with your above code, then call it for each of the enter events; eg.
Private Sub AnyFieldEnter ()
Field1.ColumnWidth = 500
Field2.ColumnWidth = 500
Field3.ColumnWidth = 500
Field4.ColumnWidth = 500
Field5.ColumnWidth = 500
End Sub
Then, the OnEnter events become:
Private Sub Field1_Enter()
AnyFieldEnter
End Sub
Private Sub Field2_Enter()
AnyFieldEnter
End Sub
and so on.
Steve Lewy
Solutions Developer
steve@lewycomputing.com.au
(dont cut corners or you'll go round in circles)