Last Record (1 Viewer)

D-Fresh

Registered User.
Local time
Today, 04:09
Joined
Jun 6, 2000
Messages
225
If I was using a While...Wend loop, How would I refer to the End-of-File??? Basically, I want to start at the top of the table, and keep .MoveNext 'ing down until the end, then break out of the loop.

Here's what I have so far..

MyDB = CurrentDB()
MyTable = MyDB.OpenRecordset("TestTable")

While( ....)
..
..
..
MyTable.MoveNext
Wend

I just need to know what to throw as the arguement for the while. Thanks in advance and apologies for this long-winded description.
 

Matt Leidemer

Registered User.
Local time
Today, 04:09
Joined
Jun 7, 2000
Messages
10
Set RST = DBS.OpenRecordSet("Table")

While Not RST.EOF
' do whatever you need to here
RST.MoveNext
Wend

I prefer to use Do-Until:

Set RST = DBS.OpenRecordSet("Table")

Do Until RST.EOF
' do whatever you need to here
RST.MoveNext
Loop

HTH

- Matt
 

Users who are viewing this thread

Top Bottom