I use Access 2007 for a lot of data conversion & normalization. I do a lot of data imports and create a lot of tables and queries on the fly. Many of the resultant tables and queries have dozens of columns, and adjusting the column widths and activating the "Best Fit" function (aka autofit or autosize) is very time consuming.
I'd like to whip up some VBA to loop through the columns to set them as I see fit. I've searched extensively on Google, but I cannot find any information on the collections, properties, and/or methods I need to use to do this.
How can I use Access VBA or a macro to programmatically access the following elements of the datasheet view of tables and queries..?
- read the column width property
- set the column width property
- activate the "Best Fit" function
EDIT: Any takers on this..? It's been a couple of weeks, and no responses. Must be a way. Of course it might be done through Windows API calls to the Access GUI controls, but I'd like to avoid that complexity if possible...