Public Sub command1_Click()
If Option1.Value = True Then
ElseIf Option2.Value = True Then
GoTo name
End If
name:
Dim a As String
a = Val(Text2.Text)
Static stud(2) As stu
Open "c:\stu_list" For Input As #1
For i = 1 To 2
Input #1, stud(i).stname, stud(i).num, stud(i).addr, stud(i).tel
If a = stud(i).stname Then
Text1.Text = stud(i).stname
Exit For
End If
Next i
Close #1
End Sub
大家帮忙看看代码错在哪里,谢谢大家了