I am having trouble with the following code. When I hit the delete the record I get a runtime error stating that "No value given for one or more required parameter." Can anyone see what I'm doing wrong? Thank you in advance.
Private Sub cmdRemoveTop10_Click()
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
rst.ActiveConnection = CurrentProject.Connection
rst.CursorType = adOpenDynamic
rst.LockType = adLockOptimistic
With rst
.Open "SELECT * FROM tblTopPick WHERE [FirstOfCompany Number]= " & "'" & txtID & "'"
.Delete
.Close
End With
Set rst = Nothing
lstView.Requery
End Sub Paul
paul_wilson74@hotmail.com
Private Sub cmdRemoveTop10_Click()
Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
rst.ActiveConnection = CurrentProject.Connection
rst.CursorType = adOpenDynamic
rst.LockType = adLockOptimistic
With rst
.Open "SELECT * FROM tblTopPick WHERE [FirstOfCompany Number]= " & "'" & txtID & "'"
.Delete
.Close
End With
Set rst = Nothing
lstView.Requery
End Sub Paul
paul_wilson74@hotmail.com