Well, I figured out my problem! I didn't realize it, but all the controls on the form where set to .Visible=False! Only Datasheet mode was allowed, so never noticed this. This didn't affect the columns from displaying on the datasheet, but apparently it prevented the columnwidths from being changed. I made them visible and now I can change the columnwidths. Go figure! (There's a few hours of my life I can't get back!)
Can't change Column Width in code in Access datasheet
Mark Liquorman
16
Reputation points
I thought I've done this before, but it doesn't seem to work now. I'm trying in code to reset the widths of columns in an Access datasheet (based on a query). I can set the .ColumnOrder and the .ColumnHidden properties just fine, but any change I make to the .ColumnWidth property is just ignored (setting in twips). I've tried in both the Form Load and Open events. With the datasheet open, I can even set the .ColumnOrder and .ColumnHidden properties for a column from the Immediate Window, but not the .ColumnWidth.
What would be preventing me from doing this?