Access VBA with SQL Server

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
 
S

Sylvain Lafontaine

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
 
E

Evan Camilleri

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
 
A

aaron.kempf

screw the rs.update/edit functionalty

docmd.runsql "update mytable set myfield = mynewvalue"
 

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