Hi,

I'm new to Visual Basic and this forum and I would like to ask if anyone could tell me if there is away of linking option buttons with text boxes.

I have to do a mulitple choice program where the questions and answers are stored in an access database. Each text field has to display one of four possible answers to the question. Each text box has an option button next to it. The user should be able to click an option box to choose what they think is the correct answer and then the program tells the user if they got the right answer or not. Therefore the option button needs to be linked to the text box some way ... i think!

If anyone can help it would be most appreciated as this is really doing my head in! :icon_cry:

Thanks,

Rob_ledo

Recommended Answers

All 3 Replies

Will all questions/answers in database stay the same? In other words - Field1 will contain the question, fields 2-5 will contain the multiple answers. 1 recset = 1 saved question and answer....

If the above is all true and questions/answers forms part of app, the following is a long way, but works with no errors.

Use a select case statement for your recordset - i.e. case - rsdata.bookmark = 2 then

if you are referring to bookmark 1 and option 3 is true, write a normal (if then elseif)statement - if opt1.value then (-20 points for example)
elseif opt2.value then (-20 point)
elseif opt3.value then (+20 points)
else
(-20 points) and so on.....

Sounds like a lot of work, but no errors can slip in when all buttons and bookmarks are referenced.

Makes no sense? Let me know and I will send code tomorrow...

Hi,

"case - rsdata.bookmark = 2 then"

I think this IS what I am missing, I know i have to use the case select and the if statements within the pselect but it was the link that I didnt know.

So the reference to the bookmark will do it? I will try this and let you know if it's worked.

Thanks very much :-)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.