|
各位好,我这里有一个ADO程序,是在“物料入库”的同时,用最新一次入库的物料单价,去更新”物料库“中该物料的单价。
但我程序好象有点问题,每次更新物料入库时,出现错误提示:”至少一个参数没有被指定值“,请各位帮忙指点一下,谢谢!!
Private Sub Form_AfterUpdate()
Dim rs物料库 As ADODB.Recordset
Dim SQLStmt As String
On Error GoTo HandleError
If Not IsNull(Me!物料编号) Then
Set rs物料库 = New ADODB.Recordset
If Not IsNull(Me!单价) Then
SQLStmt = "SELECT * FROM 物料库 " _
& "WHERE 物料编号 = " & Me!物料编号
rs物料库.Open SQLStmt, CurrentProject.Connection, _
adOpenDynamic, adLockOptimistic
If Not rs物料库.EOF Then
rs物料库![Unitprice] = Me!单价
rs物料库.Update
End If
rs物料库.Close
Set rs物料库 = Nothing
End If
End If
ExitHere:
Exit Sub
HandleError:
MsgBox "Error: " & Err.Description, vbCritical, "Access Error"
Resume ExitHere
End Sub
|
|