Requery Crosstab Subform

T

TarrynG

Hi

I have a subform which displays the datasheet view of a crosstab query. The
main form allows users to enter data which pertains to the results of the
crosstab query.

When I initially open the main form, there is not necessarily data in the
subform (i.e. no data that satisfies the query) and so the 'column ' fields
of the crosstab query are not recognised. I can trap that error, and the
subform then just shows as a blank box on my main form.

Once the user has entered data on the main form, I want to requery the
crosstab/subform to display what they have entered. However, a requery when
there was no initial data does not work.

Is there some way to 'refresh' the crosstab query/subform that will work?

I hope I have explained my problem clearly - thanks for your assistance.

Tarryn
 
A

Allen Browne

Tarryn, if you have a control in the subform for each column of the crosstab
query, then I assume you know ahead of time what the columns could be.

If so, open the crosstab in design view, open the Properties box (View
menu), and enter the list of possible field names beside the Column Headings
property.

Now the columns are fixed, and it should avoid both your first problem and
the second one as well.
 

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