• 0

[VBA] Moving through record set problem


Question

I've got a small VBA app that needs to move through records in a table from an access database, and display them in textboxes.

When I move to the next record I have the following code setup to do so:

'The Next Button:
With MyRecordSet
.MoveNext
If .EOF = True Then
.MoveLast
End If
End With
LoadTextBoxes

The above works when I move from the first entry to the second entry. However if I attempt to move from the second entry to the third entry, it won't work. It loads the second entry again.

There are currently 10 records in the table its getting data from.

Any ideas on how I can get it moving from the current record to the next?

Thanks :)

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
You're not iterating over the recordset:

With MyRecordSet
Do While Not .EOF
	'Load into appropriate textbox here
	.MoveNext
Loop
.Close
End With

Thanks Antaris,

I thought it might have do with the way my loop was setup, just couldn't put my finger on it.

However, when I attempt your suggestion it goes from the first record, to the last record. hmm..

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.