Re: Defining for Final Record in Loop

From: Douglas J. Steele (NOSPAM_djsteele_at_NOSPAM_canada.com)
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
       rs.MoveNext
   Loop

-- 
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)
"Ed the Redhead" <EdtheRedhead@discussions.microsoft.com> wrote in message
news:EAD87F44-8E5D-4742-B840-DA2DD8956A9F@microsoft.com...
> 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.