VB运行的时候出现实时错误424要求对象
代码是:DimRecord_NoAsIntegerDimstuAsStudTypePrivateSubCommand1_Click()Withstudent.iNo=Va...
代码是:
Dim Record_No As Integer
Dim stu As StudType
Private Sub Command1_Click()
With student
.iNo = Val(Text1.Text)
.strName = Text2.Text
.strSex = IIf(Option1.Value, "1", "0")
.sMark1 = Val(Text3.Text)
.sMark2 = Val(Text4.Text)
.sTotalMark = Val(Text5.Text)
End With
Open "student.dat" For Random As #1 Len = Len(stu)
Record_No = LOF(1) / Len(stu) + 1
Label8.Caption = Record_No
Put #1, Record_No, student
Close #1
End Sub
Private Sub Command2_Click()
ok = False
Me.Hide
主窗口.Show
End Sub
Private Sub Form_Load()
Open "student.dat" For Random As #1 Len = Len(stu)
Label7.Caption = LOF(1) / Len(stu)
Close #1
End Sub 展开
Dim Record_No As Integer
Dim stu As StudType
Private Sub Command1_Click()
With student
.iNo = Val(Text1.Text)
.strName = Text2.Text
.strSex = IIf(Option1.Value, "1", "0")
.sMark1 = Val(Text3.Text)
.sMark2 = Val(Text4.Text)
.sTotalMark = Val(Text5.Text)
End With
Open "student.dat" For Random As #1 Len = Len(stu)
Record_No = LOF(1) / Len(stu) + 1
Label8.Caption = Record_No
Put #1, Record_No, student
Close #1
End Sub
Private Sub Command2_Click()
ok = False
Me.Hide
主窗口.Show
End Sub
Private Sub Form_Load()
Open "student.dat" For Random As #1 Len = Len(stu)
Label7.Caption = LOF(1) / Len(stu)
Close #1
End Sub 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询