creating controls on open forms

  • Thread starter Thread starter Kenneth_J
  • Start date Start date
K

Kenneth_J

It seems like alot of people run into a similar problem...but i
haven't found a satisfactory answer.

I wish to create a report that is a test which contains about 100
multiple choice test questions which are pulled pretty much randomly
from an access database. My first thought was to loop one hundred
times creating new labels for each of the questions and updating their
caption properties to hold the questions.

But apparently you can't create new controls on an open form unless it
is in design view ?!.

So i guess there must be an altogether more elegant way to do this,
i'm new to the whole access vba stuff, so if anyone can help it would
be much appreciated.
thanks,
keith
 
I guess my approach would be to store all of the posible
questions and their multiple choice answers as fields in a
table, populate a temp table with a list of the 100
questions you want displayed (probably storing just the
the AutoID), and then use a query to join this temp table
back to the question table to generate the complete
verbiage for the test.

The report itself would not use any labels - the detail
section would simply have text boxes tied to the question
and answer fields.

This would save you a lot of messing around with
programmatically setting label properties.

There are a couple of different ways you could populate
the list of 100 questions (by hand, programatically using
the random number generator, or by using one of the
queries described here in this newsgroup to return a set
of random records).

Am I on the right track for what you are after?

Rob
 
But if i wanted to print out the report as a test, with all 100
questions on it, how could i have 100 questions listed at once on the
form with out manually creating each of the 100 controls or sets of
controls ???

thanks,
keith
 
Back
Top