multiple subforms linking

H

Hannah

I've had a wee look around all the posts on here but I seem to be going round
in circles so I'm sorry if the answer is already out there! I'm also a bit of
a (pretty much self-taught) access novice so go gently...

I'm setting up a database for a research project that has 11 different
questionnaires. What I want to be able to do is have a main form where you
can choose the type of questionnaire and depending on what you choose, the
correct subform (with all the questions from that questionnaire type) is
visible.

My plan (based on posts I've read here!) was to have a table with labels and
names of each subform and use a combo box to change the questionnaire but I
don't seem to get the code right (complete code novice!). In case I'm
explaining this horrendously, I'm thinking of Tina's response to the 'subform
linking' post! But as I say I don't get the code right at all. Any advice
would be very very much appreciated!
 
M

Marshall Barton

Hannah said:
I've had a wee look around all the posts on here but I seem to be going round
in circles so I'm sorry if the answer is already out there! I'm also a bit of
a (pretty much self-taught) access novice so go gently...

I'm setting up a database for a research project that has 11 different
questionnaires. What I want to be able to do is have a main form where you
can choose the type of questionnaire and depending on what you choose, the
correct subform (with all the questions from that questionnaire type) is
visible.

My plan (based on posts I've read here!) was to have a table with labels and
names of each subform and use a combo box to change the questionnaire but I
don't seem to get the code right (complete code novice!). In case I'm
explaining this horrendously, I'm thinking of Tina's response to the 'subform
linking' post! But as I say I don't get the code right at all. Any advice
would be very very much appreciated!


First, I want to make sure it is clear that all the code
will refer to the subform **control**. Nothing should
involve the actual form object you want to display in the
subform control.

To set the form object a subform control displays, set the
control's SourceObject property. Assuming the combo box's
BoundColumn corresponds to the subform object's name:
Me.subformcontrol.SourceObject = Me.combobox

The combo box's attached label's caption can be set using
this kind of syntax:
Me.subformcontrol.Controls(0).Caption = _
Me.combobox.Column(N)
where N is the 0 based column number in th combo box's
TowSource query that corresponds to the label field.

I assume that each form object you will be using for this
has the same linking field(s) so hopefully you will not have
to reset those properties.
 
M

Mike Painter

Hannah said:
I've had a wee look around all the posts on here but I seem to be
going round in circles so I'm sorry if the answer is already out
there! I'm also a bit of a (pretty much self-taught) access novice so
go gently...

I'm setting up a database for a research project that has 11 different
questionnaires. What I want to be able to do is have a main form
where you can choose the type of questionnaire and depending on what
you choose, the correct subform (with all the questions from that
questionnaire type) is visible.

My plan (based on posts I've read here!) was to have a table with
labels and names of each subform and use a combo box to change the
questionnaire but I don't seem to get the code right (complete code
novice!). In case I'm explaining this horrendously, I'm thinking of
Tina's response to the 'subform linking' post! But as I say I don't
get the code right at all. Any advice would be very very much
appreciated!

A table with all the questions ,answers, etc. is all that is needed.
A questionaireGroup field determines which set it is in.
A subform with a query based on the QuestionaireGroup is all that is needed.
Main form has a combo box with the Group ID and a desecription.
Dropping the subform and linking the tables is all that is required, no
code.

That's where to start.


Recording answer requires a table with UserID, questionID,other stuff, and
the answer, but this is still just a matter of using a correct query for the
subform and putting the user ID on the main form.

Retaking the test requires a bit more information but the idea is the same.
 

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