Hello everyone, it's been just a few days since I became a member here and I gotta say, what a nice site! Great people, great ideas!
I'm asking for a bit of help with a minor issue with Access. Is it possible to write VBA code to autofit fields and to alternate row color?
My main code creates tables, then populates them with data. It all works just fine. But when I open the Access file, I can't see some of the
longer fields' names entirely, they are truncated and it looks really ugly. One solution I found was to loop through all the rows in the problem field, find the longest
string and then set the field column width to that value. But it does not help me - I have a field called "NUMBER MOVING PARTS", obviously a
long name, and the values can be between 1 and 50. So this little idea is of no use: the length of the field name is much longer that the length of the variables
it contains. Sticking to my example, when I open the newly created table it shows "NUMBER MOV" and of course, if I double-click on the top right point of the field it auto-expands, but I would like to do it via code as opposed to the manual solution.
This is one issue...the second one, is it possible to alternate the row color with code?
Thank you very much!! Any feedback is greatly appreciated.
I'm asking for a bit of help with a minor issue with Access. Is it possible to write VBA code to autofit fields and to alternate row color?
My main code creates tables, then populates them with data. It all works just fine. But when I open the Access file, I can't see some of the
longer fields' names entirely, they are truncated and it looks really ugly. One solution I found was to loop through all the rows in the problem field, find the longest
string and then set the field column width to that value. But it does not help me - I have a field called "NUMBER MOVING PARTS", obviously a
long name, and the values can be between 1 and 50. So this little idea is of no use: the length of the field name is much longer that the length of the variables
it contains. Sticking to my example, when I open the newly created table it shows "NUMBER MOV" and of course, if I double-click on the top right point of the field it auto-expands, but I would like to do it via code as opposed to the manual solution.
This is one issue...the second one, is it possible to alternate the row color with code?
Thank you very much!! Any feedback is greatly appreciated.