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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Freeze datasheet column in on the fly form

Status
Not open for further replies.

MePenguin

Technical User
Oct 31, 2003
107
SE
Any way to use VBA to freeze a column in a datasheet view form?
I've found the FrozenColumns Property, which is readonly so not much help. I've managed to set the property in form view (right click on column...), but can't find out how to do this in code.

So far:

Code:
Private Sub Form_Open(Cancel As Integer)
    CODE.ColumnHidden = True
    [Species Name].ColumnWidth = 3500
    [Species Name].Locked = True
End Sub

My form is created from a temporary table that in turn is created by a crosstab query, or import from Excel. I want to freeze and lock (lock done) column 1, so that users can enter data in the remaining columns (there can be up to 80 of them, so the locking is REALLY useful!).

A workaround could be to not delete the form between instances, and just delete all the controls but the one that I want frozen, since it will always have the same name - would the freezing persist then?

An alternative would be to try to synchronize the vertical scrolling, but that sounds very complicated.

Any ideas?

Phil

---------------
Pass me the ether.
 
PS. I want to avoid using an MSExcel instance to do this. Usually leads to trouble.

Phil

---------------
Pass me the ether.
 
How are ya MePenguin . . .

You loose alot of functionality with a form in DataSheet view. However [blue]you can make a continuous form look just like a datasheet[/blue] and maintain full form functionality. From here . . . its just a matter of setting the width of the control.

Be aware: VBA measures the screen in twips or one twip = 1/1440 of an inch . . .

Calvin.gif
See Ya! . . . . . .
 
Ah, but you still can't freeze a column that way can you?
So that column1 stays on the screen when users scroll horizontally with the other column...

Phil

---------------
Pass me the ether.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top