G
Gaetan
Hi,
I'm having a problem that's driving me nuts.
Run-time error '3061': Too few parameters. Expected 1.
I'm having a listing of Associates (employees) in a continuous form from
which I can select an item in a combo box. When this item is selected, a form
pops up. On this form (frmTransferAssociate), there's a cancel button that
the user can click to cancel the operation and it removes what was entered in
the first form's combo box, thus cancelling that it was ever selected.
I've created the following code to access the underlying recordset (a query
based on a table) so that I can erase the selected item from the associate's
record.
Private Sub cmdCancel_Click()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("qlkpCurrentWorkEntry")
rst.FindFirst ("AssociateID = " & Me.txtAssociateID)
If Not rst.NoMatch Then
rst.Edit
rst![DayStatusID] = Null
rst.Update
End If
rst.Close
Set rst = Nothing
End Sub
The qlkpCurrentWorkEntry query has the following fields:
WorkEntryID (criteria: Like [Forms]![frmTransferAssociate]![txtWorkEntry])
AssociateID
DayStatusID
All controls and fields seem to be spelled correctly.
Anyone can help?
I'm having a problem that's driving me nuts.
Run-time error '3061': Too few parameters. Expected 1.
I'm having a listing of Associates (employees) in a continuous form from
which I can select an item in a combo box. When this item is selected, a form
pops up. On this form (frmTransferAssociate), there's a cancel button that
the user can click to cancel the operation and it removes what was entered in
the first form's combo box, thus cancelling that it was ever selected.
I've created the following code to access the underlying recordset (a query
based on a table) so that I can erase the selected item from the associate's
record.
Private Sub cmdCancel_Click()
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("qlkpCurrentWorkEntry")
rst.FindFirst ("AssociateID = " & Me.txtAssociateID)
If Not rst.NoMatch Then
rst.Edit
rst![DayStatusID] = Null
rst.Update
End If
rst.Close
Set rst = Nothing
End Sub
The qlkpCurrentWorkEntry query has the following fields:
WorkEntryID (criteria: Like [Forms]![frmTransferAssociate]![txtWorkEntry])
AssociateID
DayStatusID
All controls and fields seem to be spelled correctly.
Anyone can help?