B
BrianC
The following code returns multiple records to the
recordset. How do I update each record in the recordset
with the value of lngNext?
Set MyDb = CurrentDb
Set qdf = MyDb.QueryDefs("QueryBlockAv")
For Each prm In qdf.Parameters
prm.Value = Eval(prm.Name)
Next prm
Set rs = qdf.OpenRecordset(dbOpenDynaset)
rs.Edit
rs![Booking ID] = lngNext
rs.Update
rs.Close
Set rs = Nothing
This I believe only updates the first record. Is there a
way of looping through each record in the set and also
when do I know that I've got to the end?
recordset. How do I update each record in the recordset
with the value of lngNext?
Set MyDb = CurrentDb
Set qdf = MyDb.QueryDefs("QueryBlockAv")
For Each prm In qdf.Parameters
prm.Value = Eval(prm.Name)
Next prm
Set rs = qdf.OpenRecordset(dbOpenDynaset)
rs.Edit
rs![Booking ID] = lngNext
rs.Update
rs.Close
Set rs = Nothing
This I believe only updates the first record. Is there a
way of looping through each record in the set and also
when do I know that I've got to the end?