VB实时错误380无效属性值问题
我做的是学生信息管理系统的档案添加部分PublicSubload1()DimmrcAsADODB.Recordsettxtsql1="selectDISTINCT班级fr...
我做的是学生信息管理系统的档案添加部分
Public Sub load1()
Dim mrc As ADODB.Recordset
txtsql1 = "select DISTINCT 班级 from class order by 班级"
Set mrc = ExecuteSQL(txtsql1)
If mrc.EOF Then
ddd = MsgBox("请先设置班级部署!", "警告")
mrc.Close
Exit Sub
End If
Combo1(1).Clear
mrc.MoveFirst
Do While Not mrc.EOF
Combo1(1).AddItem mrc.Fields(0)
mrc.MoveNext
Loop
Combo1(1).ListIndex = 0
Combo1(0).ListIndex = 0 大神们 就是这句出的问题哦
If modi Then '如果是修改状态
Me.Caption = "修改"
txtsql1 = "select * from xj where 学号='" & Trim(Form12.MSF1.TextMatrix(Form12.MSF1.Row, 1)) & "'"
Set mrc = ExecuteSQL(txtsql1)
mrc.MoveFirst
For i = 4 To 9
Text1(i - 2).Text = mrc.Fields(i)
Next i
Text1(0).Text = mrc.Fields(0)
Text1(1).Text = mrc.Fields(1)
Combo1(0).Text = mrc.Fields(2)
Combo1(1).Text = mrc.Fields(3)
mrc.Close
Else
Me.Caption = "登记"
For i = 2 To 7
Text1(i).Text = ""
Next i
Text1(6).Text = Date
Text1(0).Text = ""
Text1(1).Text = ""
End If
End Sub
大神们帮帮忙吧,我很急哦 展开
Public Sub load1()
Dim mrc As ADODB.Recordset
txtsql1 = "select DISTINCT 班级 from class order by 班级"
Set mrc = ExecuteSQL(txtsql1)
If mrc.EOF Then
ddd = MsgBox("请先设置班级部署!", "警告")
mrc.Close
Exit Sub
End If
Combo1(1).Clear
mrc.MoveFirst
Do While Not mrc.EOF
Combo1(1).AddItem mrc.Fields(0)
mrc.MoveNext
Loop
Combo1(1).ListIndex = 0
Combo1(0).ListIndex = 0 大神们 就是这句出的问题哦
If modi Then '如果是修改状态
Me.Caption = "修改"
txtsql1 = "select * from xj where 学号='" & Trim(Form12.MSF1.TextMatrix(Form12.MSF1.Row, 1)) & "'"
Set mrc = ExecuteSQL(txtsql1)
mrc.MoveFirst
For i = 4 To 9
Text1(i - 2).Text = mrc.Fields(i)
Next i
Text1(0).Text = mrc.Fields(0)
Text1(1).Text = mrc.Fields(1)
Combo1(0).Text = mrc.Fields(2)
Combo1(1).Text = mrc.Fields(3)
mrc.Close
Else
Me.Caption = "登记"
For i = 2 To 7
Text1(i).Text = ""
Next i
Text1(6).Text = Date
Text1(0).Text = ""
Text1(1).Text = ""
End If
End Sub
大神们帮帮忙吧,我很急哦 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询