Re: Defining for Final Record in Loop

From: Ed the Redhead (
Date: 07/22/04

Date: Thu, 22 Jul 2021 04:17:06 -0700

It is based off of a form. Each record on the form is 2 lines, the first is the old info and the 2nd is the new info. The Loop tells it to replace the information in the 1st line with the information in the 2nd line. I am still pretty new to VBA and programming in Access. Is a form considered a recordset and would your code work on a form?

"Douglas J. Steele" wrote:

> 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" <> 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.