Chlaris said:
Hello,
I have dynamic columns in subform.
What happens if you set the RecordSource property of the subform as follows:
Private Sub Form_Load()
lblColumn3.Caption = "5"
txtColumn3.ControlSource = "5"
Me.RecordSource = "qryX_Crosstab"
End Sub
Here txtColumn3 is a preexisting text box on the subform and "5" is the
name of a field from the crosstab query. You should be able to
determine in advance the field names that will be returned by the
crosstab query and set the Caption's and ControlSource's appropriately
before setting the RecordSource dynamically. Any textboxes and labels
that are not used can have their Visible property set to False.
James A. Fortune
(e-mail address removed)