Sign In | Register Now About Bytes | Help | Site Map
Connecting Tech Pros Worldwide

Help pls

Question posted by: Yvan (Newbie) on July 24th, 2008 02:39 AM
I hv some problem at diz line
(Open App.Path & "/Student.txt" For Append As #2
For A = 0 To ListCount - 1
Write #2, cbo.List(A)
Next
Close #2)




Private Sub cmdResult_Click()
Dim strName As String
Dim curExam, curPractical, curCoursework, curTotal As Currency
curExam = Val(txtExam.Text)
curPractical = Val(txtPractical.Text)
curCoursework = Val(txtCourseWork.Text)
curTotal = Val(lblTotal.Caption)
curTotal = (curExam * 70 / 100) + (curCoursework * 15 / 100) + (curPractical * 15 / 100)
If curTotal >= 80 Then
If curTotal <= 100 Then
lstGrade.AddItem "A"
End If
ElseIf curTotal >= 75 Then
If curTotal <= 79 Then
lstGrade.AddItem "A-"
End If
ElseIf curTotal >= 70 Then
If curTotal <= 74 Then
lstGrade.AddItem "B+"
End If
ElseIf curTotal >= 65 Then
If curTotal <= 69 Then
lstGrade.AddItem "B"
End If
ElseIf curTotal >= 60 Then
If curTotal <= 64 Then
lstGrade.AddItem "B-"
End If
ElseIf curTotal >= 55 Then
If curTotal <= 59 Then
lstGrade.AddItem "C+"
End If
ElseIf curTotal >= 50 Then
If curTotal <= 54 Then
lstGrade.AddItem "C"
End If
ElseIf curTotal >= 45 Then
If curTotal <= 49 Then
lstGrade.AddItem "C-"
End If
ElseIf curTotal >= 40 Then
If curTotal <= 44 Then
lstGrade.AddItem "D"
End If
ElseIf curTotal >= 0 Then
If curTotal <= 39 Then
lstGrade.AddItem "E"
End If
End If
If curTotal < 0 Then
MsgBox "The Value You Have Entered are Not Acceptable!", vbCritical, "Error"
End If
If curTotal > 100 Then
MsgBox "The Value You Have Entered are Not Acceptable!", vbCritical, "Error"
End If
lblTotal.Caption = curTotal 'Display the Total Mark
lstName.AddItem txtName 'Add Student Name into Name list
lstMark.AddItem lblTotal 'Add Student Mark into Mark list
Open App.Path & "/Student.txt" For Append As #2
For A = 0 To ListCount - 1
Write #2, cbo.List(A)
Next
Close #2
End Sub
QVeen72's Avatar
QVeen72
Expert
1,258 Posts
July 24th, 2008
06:46 AM
#2

Re: Help pls
Hi,

It would be easy if you tell the error message..
I guess, the arror could be of Slash.. in VB6 you have to use "Reverse Slash"
try this :

Open App.Path & "\Student.txt" For Append As #2

Regards
Veena

Reply
Reply
Not the answer you were looking for? Post your question . . .
189,071 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
Top Visual Basic Forum Contributors