I have code in my Access Database that does the following:
In a form (MainForm) that has a record source from a table called SectionTable. The below code is looking at the first record in SectionTable, running a macro that is using the first record from the table, then moving on to the next record in the table and running the macro again. The only way I could get this to work is to repeat the below lines for the 150 records involved. I would like some code that will loop through all 150 records and then stop at the end. Loopuntilend? is there any code that can just repeat the two actions until the end of the source table?
Thanks
In a form (MainForm) that has a record source from a table called SectionTable. The below code is looking at the first record in SectionTable, running a macro that is using the first record from the table, then moving on to the next record in the table and running the macro again. The only way I could get this to work is to repeat the below lines for the 150 records involved. I would like some code that will loop through all 150 records and then stop at the end. Loopuntilend? is there any code that can just repeat the two actions until the end of the source table?
Rich (BB code):
Function RunTotalTestLoop()
On Error GoTo Err_Form_Current_Error
DoCmd.GoToRecord , , acNext
DoCmd.RunMacro "ApdTabtoTotalTest" 'the commands that you want to run
DoCmd.GoToRecord , , acNext
DoCmd.RunMacro "ApdTabtoTotalTest" 'the commands that you want to run
DoCmd.GoToRecord , , acNext
DoCmd.RunMacro "ApdTabtoTotalTest" 'the commands that you want to run
Thanks
Last edited: