给窗体添加代码如下:
Private Sub 结果1_BeforeUpdate(Cancel As Integer)
Dim strSQL As String
strSQL = "update 表1 set 表1." & 项目1.Value & "='" & 结果1.Text & "' where 表1.编号='" & 编号.Value & "'"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
End Sub
Private Sub 结果2_BeforeUpdate(Cancel As Integer)
Dim strSQL As String
strSQL = "update 表1 set 表1." & 项目2.Value & "='" & 结果2.Text & "' where 表1.编号='" & 编号.Value & "'"
DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
End Sub
[此贴子已经被作者于2006-10-7 14:21:00编辑过]
|