[AccessD] Do While Loop Problem

Charlotte Foust cfoust at infostatsystems.com
Wed Aug 24 15:48:55 CDT 2005


The problem is that it tries to evalute the first conditon before it
checks for EOF.  Try this instead:

Do While myds.EOF = false
	If myds.Fields(2) < myds5.Fields(2) Then

            'some lines of code
	End If

      myds.MoveNext
 Loop

 

Charlotte


-----Original Message-----
From: Kaup, Chester [mailto:Chester_Kaup at kindermorgan.com] 
Sent: Wednesday, August 24, 2005 1:36 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] Do While Loop Problem


The following code generates a no current record error on the do while
line. I thought it should exit the do loop when EOF = false was reached.
Thanks.

 

Do While myds.Fields(2) < myds5.Fields(2) Or myds.EOF = True

            'some lines of code

            myds.MoveNext

 Loop

 

Chester Kaup

Engineering Technician

Kinder Morgan CO2 Company, LLP

Office (432) 688-3797

FAX (432) 688-3799

 

 

No trees were killed in the sending of this message. However a large
number of electrons were terribly inconvenienced.

 

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list