Dynamic Forms

B

Banana

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
 
P

Phil

Is there a way to create a dynamic form based on a crosstab query?

Define Dynamic forms.

I I produce reports where the no of columns and headings gets changed
depending on the no of columns in the Crosstab query, if that is what you
mean. I guess the same thing could be done with a form, but whether the data
would be editable or not I'm not sure

Phil
 
L

Linq Adams via AccessMonster.com

Crosstab queries cannot be edited and hence forms based on them cannot edited.
 
D

DW

Yes it is. How do you do it?

Phil said:
Define Dynamic forms.

I I produce reports where the no of columns and headings gets changed
depending on the no of columns in the Crosstab query, if that is what you
mean. I guess the same thing could be done with a form, but whether the data
would be editable or not I'm not sure

Phil
.
 
D

David W. Fenton

Is there a way to create a dynamic form based on a crosstab query?

Embed a query as a subform in a main form. This is the only easy and
reliable way to do it.
 

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