Loop Until Last Record

mtairhead

Registered User.
Local time
Today, 04:11
Joined
Oct 17, 2003
Messages
138
If I had a simple module, like the one below....

function simple ()
docmd.openform "simple form"

a_subroutine:
docmd.gotorecord acdataform, "simple form", acdatanext
goto a_subroutine

mtairheads_subroutine:
docmd.close acdataform, "simple form"

end function

How would I get the function to jump to the "Mtairheads_subroutine" when the "Simple Form" hits the last record? I would like to do this without using the "on error" function. (You know, when we tell it to run "mtairheads_subroutine" when access encounters error # 2105)

Thanks,

Andrew
 
If you are looking for a way to loop through a recordset, open one! Don't open a form. Look up the OpenRecordset method for DAO in help. It comes with an example. Or search the archives here.
 

Users who are viewing this thread

Back
Top Bottom