i got same error
3061' Too few parameters. Expected 2. anyone help me please
here is vb code
Private Sub Form_AfterUpdate()
On Error GoTo ErrorHandler
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim calculatedSalesPercents As Double
Dim salesPercentsID As Variant
' Store the value of the SalesPercents control and calculate the result
calculatedSalesPercents = IIf([RePrice] = 0 Or [BDDUTY] = 0, 0, Round(1 - ([BDDUTY] / [RePrice]), 2))
salesPercentsID = Forms![Item Menu Suplier(03)]![SalesPercents] ' Value from the SalesPercents textbox
' Set up the database and recordset
Set db = CurrentDb()
' Add the value from the SalesPercents textbox directly to the SQL statement
Set rs = db.OpenRecordset("SELECT * FROM ItemName WHERE ID = " & salesPercentsID, dbOpenDynaset)
' If a record is found, update it
If Not rs.EOF Then
rs.Edit
rs("SalesPercents") = calculatedSalesPercents
rs.Update
End If
rs.Close
Set rs = Nothing
Set db = Nothing
Exit Sub
ErrorHandler: MsgBox "Error " & Err.Number & ": " & Err.Description End Sub