hi to all - I have a subform that shows records in datasheet form. When a button on the parent form is clicked, the query underlying the subform's datasheet changes. Each of these datasheets has 9 columns, but the Field Names change depending on the underlying query. Only the 1st column keeps the same name ("Grp_ID").
I want to change the column width of the datasheet columns for 'best fit'. The usual way to do this is to add code to the subform's Load Event
My problem is that the column names CHANGE whenever I change the query. So... Is there a way to reference the columns of the datasheet BY POSITION, not by name?
Thanks in advance for any clues.
Teach314
I want to change the column width of the datasheet columns for 'best fit'. The usual way to do this is to add code to the subform's Load Event
Code:
[indent][/indent]Private Sub Form_Load()
[indent][/indent]Me.Column1Name.ColumnWidth = -2
[indent][/indent]Me.Column2Name.ColumnWidth = -2
[indent][/indent]Me.Column3Name.ColumnWidth = -2
[indent][/indent]End Sub
My problem is that the column names CHANGE whenever I change the query. So... Is there a way to reference the columns of the datasheet BY POSITION, not by name?
Thanks in advance for any clues.
Teach314