class problem

G

Grant

I'm writing a form to collect test answers. Each answer is chosen from 5
radio buttons, A through E.
As I have over 100 questions, I want to create a class (to display the 5
radio buttons) which I can instantiate many times.
Has anyone got a basic example of using classes ? All examples I've found on
the net & whatever I try, give syntax errors or 'invalid outside procedure'
messages. I'm using Access 2003 with VB 6.3.
Thanks.
 
A

Albert D. Kallal

A class object will not help this problem, as you need to "display" those
radio buttons on a form, and a class object WILL NOT help in this case. You
can't change your form design at run time, and how do you expect to bind
class objects to a form with repeating radio ? (you simply can't do this in
access).

I explain "when" it is good idea to use a class object in access here:

http://www.members.shaw.ca/AlbertKallal/Articles/WhyClass.html

The above also has some sample class objects laid out.

I would I suggest is that you use a continues sub-form with 5 radio buttons
bound to ONE field that stores the choice. You then also simply have another
field with the text of the question.

The result of the above will be a form in which the questions, and radio
bunions repeat for you. The further beauty of this is you not have to write
any code to display the 100, or how every many questions you have.

A class object will not help at all for solving this design, and is compete
inappropriate for your needs here. Your taking the wrong approach, and using
class objects is the wrong design approach to take here.

Continues forms are what you need for this "repeating" data, since you can
bind the radio buttons to a record, and THEY WILL ALSO repeat on the form
for you. Here is some screen shots and some ideas of using continues forms
in ms-access:

http://www.members.shaw.ca/AlbertKallal/Articles/Grid.htm
 

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

Similar Threads


Top