Note that there are some explanatory texts on larger screens.

plurals
  1. POrandomly generate 40 questions in vb6? please help me
    text
    copied!<p>i've been trying to create a vb6 code that will randomize 10 questions but it's not working. i use sql as my database</p> <p>here's my code:</p> <pre><code>Private Sub cmdNext_Click() Dim real_ans As String Dim nCnt As Integer 'nCnt = nCnt + 2 'Label3.Caption = nCnt real_ans = Adodc1.Recordset.Fields("answer") With Adodc2.Recordset Dim grade As String If (real_ans = "A" And Option1.Value = True) Or (real_ans = "B" And Option2.Value = True) Or (real_ans = "C" And Option3.Value = True) Or (real_ans = "D" And Option4.Value = True) Then .Fields("english_score").Value = .Fields("english_score").Value + 1 nEnglish_score = Adodc2.Recordset.Fields("english_score").Value Select Case nEnglish_score Case Is &gt;= 7 'If score above 80... grade = "genius" 'Give an A With Adodc2.Recordset .Fields("IQ").Value = grade End With Case Is &gt;= 6 'If score above 70... grade = "Superior " 'Give a B With Adodc2.Recordset .Fields("IQ").Value = grade End With Case Is &gt;= 5 'If score above 60... grade = "High Average" 'Give a C With Adodc2.Recordset .Fields("IQ").Value = grade End With Case Is &gt;= 4 'If score above 50... grade = "Average" 'Give a D With Adodc2.Recordset .Fields("IQ").Value = grade End With Case Is &gt;= 3 'If score above 40... grade = "Low Average " 'Give a E With Adodc2.Recordset .Fields("IQ").Value = grade End With Case Is &gt;= 2 'If score above 30... grade = "Moron" 'Give a F With Adodc2.Recordset .Fields("IQ").Value = grade End With Case Is &gt;= 1 'If score above 20... grade = "Idiot " 'Give a G With Adodc2.Recordset .Fields("IQ").Value = grade End With Case Else 'Else grade = "xxxx" 'Give a G With Adodc2.Recordset .Fields("IQ").Value = grade .Update End With End Select End If Adodc1.Recordset.MoveNext End With End Sub Private Sub Command1_Click() frmExam2.Show frmExam2.SetFocus End Sub Private Sub Form_Initialize() Command1.Enabled = False With Adodc2.Recordset .AddNew .Fields("name").Value = cStudent_Name .Fields("section").Value = cStudent_Section .Fields("english_score").Value = "0" .Fields("math_score").Value = "0" .Fields("abstract").Value = "0" .Fields("total_average").Value = "0" .Fields("IQ").Value = "0" .Update End With End Sub Private Sub Text1_Change() If Text1.Text &lt;&gt; "" Then cmdNext.Enabled = True Else Command1.Enabled = True cmdNext.Enabled = False End If End Sub </code></pre> <p>Please help me i cant figure out whats wrong.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload