Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Freeze" subform columns (datasheet view)

Status
Not open for further replies.

pdtit

Technical User
Nov 4, 2001
206
BE
Hey,

I was just wondering if it is possible to "freeze" my columns of a subform in datasheet view, so that no sizes, columns, widths or hights can be changed by the mouse drag.

I had a call from a customer this morning who moved with his mouse instead of clicking with it, and the column/row which shows data "had dissapeared".

It took me about 30min to understand the real thing, and so it was fixed in just a second.

However, I want to prevent these situations.

Regards,

PdtIt
 
Unfortunately, there is no way to lock the width, height, etc of columns and rows in datasheet view.

However, you can "reset" these properties from code. I use the OnOpen event of the form that is being displayed in datasheet view to set the viewing properties of the columns. That way, if a customer resizes a column, the next time they open that form, it is put back to the width that I want it to be.

For example, you have the following Textbox and combo box controls on a form that is displayed in datasheet view:
txtBox1, txtBox2, txtBox3, cboControl1

Me.txtBox1.ColumnWidth = 1800
Me.txtBox2.ColumnWidth = 4000
Me.cboControl1.ColumnWidth = 1800
Me.txtBox3.ColumnWidth = 1500

You can also set these properties:
Me.txtBox1.ColumnHidden
Me.RowHeight

Check the online help for more information on these properties.

You can control virtually every aspect of the form from code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top