[ 本帖最后由 fisho 于 2007-8-15 17:38 编辑 ]作者: Henry D. Sy 时间: 2007-8-16 09:28 标题: 回复 #1 fisho 的帖子 1。将文本框改为组合框----方便输入数据以及防止输入不在表中的Sn值
2。按钮事件中加入下面代码
Dim rs As New adodb.Recordset
Dim cnn As New adodb.Connection
Dim strSql As String
Set cnn = CurrentProject.Connection
strSql = "select * from main where sn='" & Me.TXTSN & "'"
rs.Open strSql, cnn, adOpenKeyset, adLockOptimistic
With rs
.Fields("co") = True
.Update
End With
rs.Close
Set rs = Nothing
Set cnn = Nothing