linking two sub-forms withing a form

G

Guest

Hi,
Thanks for the advice to use subforms. Now I have another problem.
I have a form (which is basically just titles, etc, no actual records) into
which I have inserted two subforms - the first to serve as a row heading
(left) and the second to show the records (right) - basically it is a form
createad with a crosstab query which has been split into two sub-forms (one
row heading and one for the actual values).
Can anyone give a suggestion how I could connect these two subforms so that
when I scroll one of them the other will scroll with it automatically - and
the scroll bars on the main form would be turned off?
Many thanks in advance.
Cheers,
Edith
 
J

John W. Vinson

Hi,
Thanks for the advice to use subforms. Now I have another problem.
I have a form (which is basically just titles, etc, no actual records) into
which I have inserted two subforms - the first to serve as a row heading
(left) and the second to show the records (right) - basically it is a form
createad with a crosstab query which has been split into two sub-forms (one
row heading and one for the actual values).
Can anyone give a suggestion how I could connect these two subforms so that
when I scroll one of them the other will scroll with it automatically - and
the scroll bars on the main form would be turned off?
Many thanks in advance.
Cheers,
Edith

You may have more problems than you think. No Crosstab query is EVER
updateable; each "record" in a crosstab is actually a composite of multiple
records, so Access won't be able to determine what to update.

Why not make the second subform a proper subform of the first? What in fact
are the recordsources (post the SQL) for these two forms?

John W. Vinson [MVP]
 
G

Guest

Hi,

Thanks for the reply.
My forms are based on one table. The reason I haven't used a sub-form within
a sub-form is that it does not allow to use 'continuous form' in the main
form in that case. And I need my form in a continuous form view. I might use
a datasheet view, but then it would be more difficult to add row and column
totals, or no? And the table is quite big, so needs scrolling both up/down
and left/right - that is why I need to freeze both the row/column headings
and totals.
The data in the table are final and there is no need to be able to make any
changes to them.
You would still recommend using a sub-form within the sub-form?
Cheers,
Edith
 
J

John W. Vinson

Hi,

Thanks for the reply.
My forms are based on one table. The reason I haven't used a sub-form within
a sub-form is that it does not allow to use 'continuous form' in the main
form in that case. And I need my form in a continuous form view. I might use
a datasheet view, but then it would be more difficult to add row and column
totals, or no? And the table is quite big, so needs scrolling both up/down
and left/right - that is why I need to freeze both the row/column headings
and totals.
The data in the table are final and there is no need to be able to make any
changes to them.
You would still recommend using a sub-form within the sub-form?

Well, it's a bit more work, but you can use two coordinated subforms, with the
second subform displaying data from the currently selected record on the first
subform. To do so you need a "relay" textbox on the main form.

Put a textbox named txtRelay on the main form (you can set its Visible
property to No so the user doesn't see it) with a control source of

=FirstSubform.Form!txtID

where FirstSubform is the name of the Subform Control containing the first
subform (not necessarily the same as the name of the form within that
control), and txtID is the name of a control on that form which contains the
linking field.

The second subform's properties should be set with the Master Link Field being
txtRelay (the name of your new textbox) and the Child Link Field being the
name of the appropriate field within the second subform's recordsource.

John W. Vinson [MVP]
 

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