Visual Basic:
If mcqChk.Checked = True Then
qnManagement.addMCQqn(MCQqnTf.Text, MCQ1.Text, MCQ2.Text, MCQ3.Text, _
MCQ4.Text, corrAnswer)
ElseIf fillChk.Checked = True Then
qnManagement.addFillQn(fillTf.Text, fillAnsTf.Text)
End If
this arguement is supposed to call for these 2 method in my module when i click button A
Visual Basic:
Public Function addMCQqn(ByVal quest As String, ByVal ans1 As String, _
ByVal ans2 As String, ByVal ans3 As String, _
ByVal ans4 As String, ByVal corrAns As String)
isMCQ(arrPosM) = entryForm.qnNum
qnTypes(arrayPos) = "M"
arrPosM += 1
mcqQn(arrayPos) = quest
mcqAns1(arrayPos) = ans1
mcqAns2(arrayPos) = ans2
mcqAns3(arrayPos) = ans3
mcqAns4(arrayPos) = ans4
correctAns(arrayPos) = corrAns
MessageBox.Show("Question Submitted" & vbCr & isMCQ.Length & vbCr & isFill.Length)
arrayPos += 1
ReDim Preserve isMCQ(arrPosM)
ReDim Preserve isFill(arrPosF)
ReDim Preserve isMCQ(arrayPos)
ReDim Preserve qnTypes(arrayPos)
ReDim Preserve mcqQn(arrayPos)
ReDim Preserve mcqAns1(arrayPos)
ReDim Preserve mcqAns2(arrayPos)
ReDim Preserve mcqAns3(arrayPos)
ReDim Preserve mcqAns4(arrayPos)
ReDim Preserve correctAns(arrayPos)
End Function
Public Function addFillQn(ByVal quest As String, ByVal answer As String)
isFill(arrPosF) = entryForm.qnNum
qnTypes(arrayPos) = "F"
arrPosF += 1
fillQn(arrayPos) = quest
fillAns(arrayPos) = answer
MessageBox.Show("Question Submitted" & vbCr & isMCQ.Length & vbCr & isFill.Length)
arrayPos += 1
ReDim Preserve isMCQ(arrPosF)
ReDim Preserve fillQn(arrayPos)
ReDim Preserve fillAns(arrayPos)
End Function
for the 1st time..when i press the button A...it is successful..after that when i changed the checked radio button for the second time and click button A..it says the array is out of the index bound...i dont get it...cause when i only have one method..it works fine...
anyone knows where the fault lies?