请问下我现在查询到数据的存在了但是编辑代码执行不过去啊,麻烦版主帮忙看下不胜感激。
Dim a As Integer
a = DCount("*", "房金条线", "员工编号 = '" & Me.员工编号 & "'and 日期=#" & Me.日期 & "#")
If a > 0 Then
Dim rst As DAO.Recordset
Dim strSQL1 As String
Dim strID As String
Dim strid1 As String
strID = Me.员工编号
strid1 = Me.日期
strSQL1 = "select * from 业绩表 where 员工编号='" & strID & "'and 日期='" & strid1 & "'"
Set rst = CurrentDb.OpenRecordset(strSQL1, dbOpenDynaset)
rst.MoveFirst
rst.Edit
rst!日期 = Me.日期
rst!产品A = Me.Text2
rst!产品B = Me.Text4
rst!产品C = Me.Text6
rst!产品D = Me.Text8
rst!产品E = Me.Text10
rst.Update
rst.Close
Set rst = Nothing
Forms(frm_业绩表).Requery
'修改数据后,关闭窗体
DoCmd.Close acForm, "frm_业绩表"
End If