Can anyone tell me what I am doing wrong? And Tell me what I should have as the right code

Read the following instructions, my code is below it.


The third button will bring the user to a form that allows entry of Student marks into a file. Upon indicating that the user has completed entering marks for one student have the program calculate the average mark, display that mark in a message box and then clear the screen to allow for a new student.
The must also be a button to allow return to main menu.
My code is:

Private Sub cmdAddToFile_Click()

Dim strName As String
Dim intMarks As Integer
strName = txtStudentName.Text
intMarks = Val(txtMark.Text)


'Open file to add student marks to it (append)

If IsNumeric(txtStudentName.Text) Then
MsgBox "Please Enter Text, not a number", vbOKOnly, "Error"
Else
If txtStudentName.Text <> "" Then
If IsNumeric(txtMark.Text) And Val(txtMark.Text) >= 0 And Val(txtMark.Text) <= 100 Then
Open "C:\My Documents\StudentMarks.txt" For Append As #1
Write #1, strName, intMarks
Close #1
Else
MsgBox "Please enter a number from 1 to 100"
End If
txtMark.Text = ""
txtMark.SetFocus
Else
MsgBox "Please Enter Student Name", vbOKOnly, "Error"
txtStudentName.SetFocus
End If
End If


End Sub

Private Sub cmdAverage_Click()
'Displays student average mark in a Message box and student name in a label
'Totals Student marks
'Give an average in a message box
Dim msngTotal As Long
Dim mintCount As Integer

Open "C:\My Documents\StudentMarks.txt" For Input As #1

Do Until strName = txtStudentName.Text
Input #1, strName, intMarks
lblTitle.Caption = strName
Loop
If strName = txtStudentName.Text Then
msngTotal = msngTotal + intMarks
mintCount = mintCount + 1
MsgBox ("Your Mark is:" & " " & msngTotal / mintCount)

End If




Close #1


txtMark.Text = ""
txtMark.SetFocus
End Sub

Private Sub cmdDone_Click()
Dim msngTotal As Long
Dim mintCount As Integer

Dim strYesNo As String
strYesNo = MsgBox("Are you done entering Student Marks?", vbYesNo + vbQuestion, "Confirm Done Entering Marks?")
If strYesNo = vbYes Then

Open "C:\My Documents\StudentMarks.txt" For Input As #1
Do Until EOF(1)
Input #1, strName, intMarks
lblTitle.Caption = strName
Loop
Close #1
Call cmdAverage_Click
End If



End Sub