-
Nov 19th, 2013, 02:19 AM
#1
Thread Starter
New Member
how to break for...next statement
helo guys have a good day..any way i have problem im making quiz project but im stuck for loop please any one can help me?
example(i have 60 array form loop.. i i can't stop the loop if the user get 5 wrong or get 40 correct..
here my sample code
For i = 0 To intfForms - 1
Set frmQuiz = Forms.Add("frmQuiz" & frmQuizArray(i))
frm.Show vbModal
Set frm = Nothing
Next i
i want to insert this code
if quiz.markwrong = 5 then
formfailed.show
elseif quiz.mark check = 40 then
formpassed.show
else
quiz.markWrong = quiz.markWrong
quiz.markCheck = quiz.mark check
End if
thanks
sorry for my bad English and ugly code im just a newbie
-
Nov 19th, 2013, 07:01 AM
#2
Re: how to break for...next statement
Welcome to the forums.
I'm not completely sure what you are trying to accomplish, but if you need to get out of a For/Next loop use
-
Nov 19th, 2013, 09:11 AM
#3
Re: how to break for...next statement
I'm trying to wrap my mind around this one:
Code:
Set frmQuiz = Forms.Add("frmQuiz" & frmQuizArray(i))
frm.Show vbModal
Set frm = Nothing
You set frmQuiz, but use frm in the next line.....
Last edited by Zvoni; Tomorrow at 31:69 PM.
----------------------------------------------------------------------------------------
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------------------
People call me crazy because i'm jumping out of perfectly fine airplanes.
---------------------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad
-
Nov 19th, 2013, 02:27 PM
#4
Thread Starter
New Member
Re: how to break for...next statement
Originally Posted by Hack
Welcome to the forums.
I'm not completely sure what you are trying to accomplish, but if you need to get out of a For/Next loop use
Thanks Hack.. a little bit i can move on.. let me explain you what i want to accomplish is a Quiz Project i decided to make 40 form..
each form have a difference question. thanks for your forum i find out how to random it.. here is my problem im stuck to break the random loop form.. im trying to insert this..
if the USER(person) hit 5 Wrong the the loop will stop and FormFail will appear /if the User(person) reach the 40 passing score formpassed will appear..
Code:
intNumberOfForms = 10
frmQuizArray = Shuffle(intNumberOfForms - 1)
For i = 0 To intfForms - 1
Set frm = Forms.Add("frmQuiz" & frmArrQuizArray(i))
If quiz.markWrong >= 5 Then
FormFail.Show
Exit For
ElseIf quiz.markCheck >= 40 Then
FormPassed.Show
End If
Next i
its working but some times debug(object unloaded)... did i mistaken to if..else statement.
im realy trying to understand it but i cant figure out.. thanks again Hack and God bless you
-
Nov 19th, 2013, 02:29 PM
#5
Thread Starter
New Member
Re: how to break for...next statement
My bad
-
Nov 19th, 2013, 04:15 PM
#6
Re: how to break for...next statement
You have 40 forms for a quiz??
What's the difference for the 40 questions in the quiz, besides the question and it's answers?
-
Nov 25th, 2013, 07:19 AM
#7
Re: how to break for...next statement
Use just one form for the quiz. This one form can contain 40 questions easily.
-
Nov 25th, 2013, 08:02 PM
#8
Re: how to break for...next statement
Originally Posted by Hack
Use just one form for the quiz. This one form can contain 40 questions easily.
Or mhadz could set it out like the wizards such as they only seem to use one form and each time you click "Previous" or "Next" the form is refreshed with the new information.
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Nov 26th, 2013, 02:47 AM
#9
Lively Member
Re: how to break for...next statement
mhadz, you're trying to take all the fun out of it, unless you are really stuck for time.
One of the big thrills of school for me was that I never knew what I would get on tests. Partly because I spent my evenings drinking beer instead of studying.
The tests were exciting because I didn't know whether I had passed or failed for days some times.
Remember, the client's needs come first. Maybe your clients need a little thrill rather than an instant answer.
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
|