Problem with MoveNext command

N

ndunwoodie

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
 
T

tina

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top