Problem with MoveNext command

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can someone tell me why this code never moves beyond the first record?

Dim strSQL As String
rst.Open "tblStaff", CurrentProject.Connection, adOpenDynamic,
adLockOptimistic

Do While Not rst.EOF
strSQL = "Update tblStaff " & _
"Set datStartDate = DateAdd('d', 1, datStartDate)" & _
"WHERE UCASE(txtQual) = 'X'"
CurrentDb.Execute strSQL, dbFailOnError
rst.MoveNext
Loop
 
it doesn't appear that your SQL statement is referencing a value in a
specific recordset field. so if you have 10 records in the recordset, the
identical query is run 10 times. or have you left out part of the code in
this procedure?

hth
 
Back
Top