R
Rick
I need to have a form randomly display test questions from
a table. In order to do this, the code needs to first
know how many records are in the table. I have tried to
figure out how to use "recordcount" and have had no luck.
Ultimately, I'd like to use the following lines to go to a
random record:
MyValue = Int((varnumber * Rnd) + 1)
DoCmd.GoToRecord , , acGoTo, MyValue
where varnumber = the number of records.
Can anyone give me a fairly exact example of how to get
the number of records in my table and store the result in
the variable varnumber?
Is there an easier way to have a random record selected
each time a button is pushed?
At some point I may use queries to limit the types of
questions to be used for each particular test and then I
will need to count the results of the query, not the
entire table, but I will worry about that later.
Thanks for your help!!!!
Rick
a table. In order to do this, the code needs to first
know how many records are in the table. I have tried to
figure out how to use "recordcount" and have had no luck.
Ultimately, I'd like to use the following lines to go to a
random record:
MyValue = Int((varnumber * Rnd) + 1)
DoCmd.GoToRecord , , acGoTo, MyValue
where varnumber = the number of records.
Can anyone give me a fairly exact example of how to get
the number of records in my table and store the result in
the variable varnumber?
Is there an easier way to have a random record selected
each time a button is pushed?
At some point I may use queries to limit the types of
questions to be used for each particular test and then I
will need to count the results of the query, not the
entire table, but I will worry about that later.
Thanks for your help!!!!
Rick