Access VBA with SQL Server

  • Thread starter Thread starter Evan Camilleri
  • Start date Start date
E

Evan Camilleri

1: I am looping through a recordset and editing data, the MoveNext will leave it in the same record. Another MoveNext is required! WHY?

Do While Not rs.EOF
Debug.Print rs!Name

rs!Name = rs!Name & "-"
rs.Update

Debug.Print rs!Name

rs.MoveNext
Loop


2 : Any good site for Access VBA with SQL Server?


Evan
 
Maybe there are duplicates in the recordset.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF


1: I am looping through a recordset and editing data, the MoveNext will leave it in the same record. Another MoveNext is required! WHY?

Do While Not rs.EOF
Debug.Print rs!Name

rs!Name = rs!Name & "-"
rs.Update

Debug.Print rs!Name

rs.MoveNext
Loop


2 : Any good site for Access VBA with SQL Server?


Evan
 
No! It was the obvious first thing I checked!!

I solved it by saying CursorLocation = adUseClient

Evan
"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)> wrote in message Maybe there are duplicates in the recordset.

--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF


1: I am looping through a recordset and editing data, the MoveNext will leave it in the same record. Another MoveNext is required! WHY?

Do While Not rs.EOF
Debug.Print rs!Name

rs!Name = rs!Name & "-"
rs.Update

Debug.Print rs!Name

rs.MoveNext
Loop


2 : Any good site for Access VBA with SQL Server?


Evan
 
screw the rs.update/edit functionalty

docmd.runsql "update mytable set myfield = mynewvalue"
 
Back
Top