Re: Defining for Final Record in Loop

From: Douglas J. Steele (
Date: 07/21/04

Date: Wed, 21 Jul 2021 17:26:44 -0400

What is the loop you're using? If it's on a recordset, it should be
something like:

   Do While rs.EOF = False
' put your code here

Doug Steele, Microsoft Access MVP
(no e-mails, please!)
"Ed the Redhead" <> wrote in message
> I've got a Loop function which I'm using to do a certain function to each
record on a form.  The problem I have is that I don't know how to tell it to
stop when it's the last record.  If I have the form set to allow additions,
it adds new records ad infinitum.  If I have the form set to not allow
additions, it comes up with an error message.  Does anyone know how to solve
this problem?  I'm sure that it has to do with the "Do Until/While" or "Loop
Until/While", but I don't know what the rest of the command is.
> Thanks.