主题:[求助]实时错误'424'
窗口代码如下:
Private Sub Form_Load()
FrmModifysinfo.Width = 8700 '窗口宽度
FrmModifysinfo.Height = 6540 '窗口高度
Combosex.AddItem "男"
Combosex.AddItem "女"
Call conn '模块调用
txtsql1 = "select class_no from class"
mrc.Open txtsql1, cnn, 3, 3
For i = 1 To mrc.RecordCount
ComboClassNo.AddItem mrc.Fields(0) '加入到列表框
mrc.MoveNext
Next i
mrc.Close
mrc.Open "select * from student", cnn, 3, 3
Call viewcmd '模块调用
End Sub
模块:
Public Sub viewcmd()
txtsid.Text = mrc.Fields(0)
Txtname.Text = mrc.Fields(1)
Combosex.Text = mrc.Fields(2)
Txtborn.Text = Format(mrc.Fields(3), "yyyy-mm-dd")
ComboClassNo.Text = mrc.Fields(4)
txttel.Text = mrc.Fields(5)
txtrudate.Text = Format(mrc.Fields(6), "yyyy-mm-dd")
txtaddress.Text = mrc.Fields(7)
txtcomment.Text = mrc.Fields(8)
End Sub
----------------------------------------------
Public Sub conn()
cnn.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=" + App.Path + "\user_info.mdb;"
cnn.Open
Set mrc.ActiveConnection = cnn
End Sub
一运行就提示"实时错误'424'",实在不解,是不是模块程序哪里不对?望大虾帮助![em10]
Private Sub Form_Load()
FrmModifysinfo.Width = 8700 '窗口宽度
FrmModifysinfo.Height = 6540 '窗口高度
Combosex.AddItem "男"
Combosex.AddItem "女"
Call conn '模块调用
txtsql1 = "select class_no from class"
mrc.Open txtsql1, cnn, 3, 3
For i = 1 To mrc.RecordCount
ComboClassNo.AddItem mrc.Fields(0) '加入到列表框
mrc.MoveNext
Next i
mrc.Close
mrc.Open "select * from student", cnn, 3, 3
Call viewcmd '模块调用
End Sub
模块:
Public Sub viewcmd()
txtsid.Text = mrc.Fields(0)
Txtname.Text = mrc.Fields(1)
Combosex.Text = mrc.Fields(2)
Txtborn.Text = Format(mrc.Fields(3), "yyyy-mm-dd")
ComboClassNo.Text = mrc.Fields(4)
txttel.Text = mrc.Fields(5)
txtrudate.Text = Format(mrc.Fields(6), "yyyy-mm-dd")
txtaddress.Text = mrc.Fields(7)
txtcomment.Text = mrc.Fields(8)
End Sub
----------------------------------------------
Public Sub conn()
cnn.ConnectionString = "provider=microsoft.jet.oledb.4.0;data source=" + App.Path + "\user_info.mdb;"
cnn.Open
Set mrc.ActiveConnection = cnn
End Sub
一运行就提示"实时错误'424'",实在不解,是不是模块程序哪里不对?望大虾帮助![em10]