奇特现象:记录集自动赋值了!请问怎么解决?
我的一个按钮事件代码为:Private Sub cmdrefresh_Click()
cmdrefresh.Enabled = False
SQL = "select * from 学生信息表 order by ID"
rs.Close
rs.Open SQL, conn, 3, 3
Set DataGrid1.DataSource = rs
display
sum
Labsit.Caption = "状态:正常"
cmdrefresh.Enabled = True
End Sub
Private Sub display()
Textid.Text = rs("ID")
Textname.Text = rs!姓名 & ""
Textsex.Text = rs!性别 & ""
Textxuehao.Text = rs!学号 & ""
Textsf.Text = rs!身份证号 & ""
Textzy.Text = rs!专业 & ""
Textaddr.Text = rs!住址 & ""
Textyb.Text = rs!邮编 & ""
Textht.Text = rs!合同号 & ""
Textbiye.Text = rs!毕业 & ""
Textfirst.Text = rs!第一次划款 & ""
Textfirsttime.Text = rs!第一次划款时间 & ""
Textsecond.Text = rs!第二次划款 & ""
Textsecondtime.Text = rs!第二次划款时间 & ""
Textthird.Text = rs!第三次划款 & ""
Textthirdtime.Text = rs!第三次划款时间 & ""
Textforth.Text = rs!第四次划款 & ""
Textforthtime.Text = rs!第四次划款时间 & ""
temp = Textid.Text
End Sub
结果发现点击此按钮后,原来没有值的记录却自动添加了3000这个值,需要点击“上个记录”或“下个记录”后才能正常显示,请问怎么回事?