Display result of crosstab query in form

R

Ronald

Hi.

In Access 2007 I want to display the result of a crosstab query in a
(continuous) form.
I've code that puts the field names of the query into the Caption of the
labels and ControlSource of the textboxes, but when I open the form the
#NAME? error is displayed in the textboxes.

Even in design when I select the names into the ControlSource I get the
message that the name is not in the list!

What is happening and how can I get it working?

Thanks in advance,

Ronald.
 
A

Allen Browne

In a crosstab query, the column names come from the field you specified for
Column Headings. Therefore they change, depending on the data in the field
and the criteria you apply. You can't make a form with controls bound to
those fields, since you do not know the field names at design time.

One possibility is to specify the column headings in the query's properties.
That way it will generate those columns (even if there's no data for them),
and only those columns (ignoring any other values found in the Column
Heading field.)

Details:
http://allenbrowne.com/ser-67.html#ColHead
 

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