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

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
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,216,098
Messages
6,128,812
Members
449,468
Latest member
AGreen17

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