recordset movenext propety

Arafat

Board Regular
Joined
May 3, 2011
Messages
61
Hello,

I have a userform on excel that connects to ms access DB, i have developed the code to display,movenext and update records but i have an issue when i try to move to the next record with SQL query that filters records.

ex: SQLquery= select * from table1 where test1='unique' --- then i do rs.movenext but everytime i click on cmd button it shows only next record even if the query returned 4 records... can anyone point where i am making the mistake ? I have several textboxes on the userform that displays the field values from access.
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
rs.movenext but everytime i click on cmd button it shows only next record even if the query returned 4 records...

movenext shows the next record. To see all four records you must movenext again, then again.
 
Upvote 0
Hi Xenou,

Thank you for your reply, i have resolved this issue.

Solution:

I made recordset and connection as global variables and used them to manipulate records and this way i was able to navigate without any glitch. It was a good learning.
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top