Automatically changing subforms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a data entry form that has a subform that contains questions that is
based on a particular classification. I would like to create a subform for
this data entry form that changes the questions based on the classification
that's chosen. Is this possible?
 
Yes, but that would not be the best way to do it. Your questions should be
in a table that has at least two fields, Classification and Question.

Include the Classification in your Link Master/Child properties in your
subform control. This means the Classification also has to be a field in
your master record.

Now when you change master records, the correct questions will be presented.

I am sure the questions are dynamic enough to warrent doing this with a
table. It is much easier to open a table and add or change questions than it
is to create or modify subforms each time.

If you insist on your current method, all you need to do to change subforms
is put the following code in your main form module where you will want to
change the subform.

Me.MySubFormControlName.SourceObject = "MySubFormName"

Don't confuse the subform with the subform control on your main form. They
are totally differenct.
 

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

Back
Top