|
-
Feb 16th, 2011, 06:35 AM
#1
Thread Starter
New Member
VB Variables
Hi, how do I assign my radio buttons and labels as a variable?
I am doing a quiz project and i want my labels to be different each time with different answers to choose from. All of my questions and answers are on Access. I need to display them on my radio buttons and labels. Any idea how i can do that?
Any advice will be appreciated.
thank you
-
Feb 16th, 2011, 06:43 AM
#2
Fanatic Member
Re: VB Variables
I didnt get your question completely.
-
Feb 16th, 2011, 06:48 AM
#3
Thread Starter
New Member
Re: VB Variables
 Originally Posted by Abid Durrani
I didnt get your question completely.
I just want to know how I can assign radio buttons and labels as a variable.
-
Feb 16th, 2011, 08:25 AM
#4
Re: VB Variables
Answer to your question:
Code:
Dim radio As RadioButton
radio = RadioButton1
VB6 Library
If I helped you then please help me and rate my post!
If you solved your problem, then please mark the post resolved
-
Feb 16th, 2011, 09:10 AM
#5
Fanatic Member
Re: VB Variables
@marman, would that not be
vb Code:
Dim radio as New RadioButton radio=RadioButton1
if i get your question correctly then i would place all the questions, answers in a list(of QA) {where QA would be defined by a structure containing Question, AnswerA,AnswerB etc and anything else (like score)} then i would create a random number function which would populate the list(of QA) with randomly selected questions from your database (ensuring in this function that you have not duplicated the question in the list already. It is then a case of using a For each loop to populate the form contents.
If debugging is the process of removing bugs, then programming must be the process of putting them in.
-
Feb 16th, 2011, 09:21 AM
#6
Re: VB Variables
@Megalith: Depends. Do you want an existing radiobutton or a new one. If you want a new one then your first statement is correct since it creates a new button. But then you destroy the new button with your second statement which replaces the new button with an existing one.
We don't know since it wasn't explained clearly. But choices are good!
VB6 Library
If I helped you then please help me and rate my post!
If you solved your problem, then please mark the post resolved
-
Feb 16th, 2011, 09:31 AM
#7
Fanatic Member
Re: VB Variables
Agreed, ultimately the OP needs to supply more info and hopefully an example of code written to date or specific problems encountered
If debugging is the process of removing bugs, then programming must be the process of putting them in.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|