DW said:
Is there a way to create a dynamic form based on a crosstab query?
The general principle would be something like this:
1) Determine the maximum number of columns you want to allow.
2) Create as many controls as you need, plus any other "details" that
may not be directly associated with the crosstab query.
3) For the controls that will represent the crosstabbed columns, name
them consistently ("Textbox1", "Textbox2"..."TextboxN")
4) In the form's load event, open a recordset based on the crosstab,
count the actual number of the columns
5) For Textbox1..Textbox(actual numbers), make them visible and the
remainder invisible.
6) If there are any controls you want to display to the right of the
crosstabbed columns, set its Left property to the (ActualCount *
Textbox.Width + LeftOffset)
7) Set the Textbox1...Textbox(actual numbers)' ControlSource to that of
the crosstabbed columns' name
8) Set the recordset to the Form.Recordset.
9) You're done.
HTH