recordset syntax

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

I'm trying to update a table based on a query string, but I'm not using the
recordset properly I think:

Public Sub UpdSomeEmployeeRelatedID(aLkupField As String, _
aRelatedID As Variant, anEmpIDCollection As
Collection)

Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim vItem As Variant
Dim sql As String
Set db = CurrentDb
For Each vItem In anEmpIDCollection
sql = qryUpdEmplyeesBySomeID(aLkupField, aRelatedID, vItem)
Set rs = db.OpenRecordset(sql)
Next vItem

rs.Close
Set rs = Nothing
Set db = Nothing
End Sub

TIA,
Eric
 
What do you think is supposed to happen when you run this code? Opening a
recordset and then moving on to another recordset is not going to update a
table.

Tell us more details.
 
Back
Top