Show Crosstab query on a continuous form

S

Samantha

Hi,

Is it possible to show a crosstab query on a single form (at the Detail
section) and have variable (not fixed) number of Value columns to display? I
know that I can insert a datasheet subform for the Crosstab query, but
thought that it might load faster (and it looks better) if it were one
continuous form.
Thanks in advance.
 
A

Allen Browne

To do this, you would need to design a continuous form with the max number
(255?) of unbound text boxes you could need. Then in the form's Open event,
run a query to determine the actual fields that will be returned this time,
and assign the field names to the ControlSource of the text boxes, setting
the Visible property of the unused ones to False. Set the Left and Width of
the used text boxes to take up the available space.

Be sure to assign the list of fields to the PIVOT clause of the form's
RecordSource too, so it doesn't fail if the data changes while the form is
open and the form gets requeried.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top