Hi. I have VB code that looks at a table connected to a form and runs a macro ("ApdTabtoTotalTest"). I have it set up to go to the next record. It works, but the issue is that I have to manually run the code for each record. There are around 150 records. So I click a button and it runs. I then have to click again to move onto the next record. It only takes a minute or so, but I would like the code to automatically scroll through all the records in the table and run the macro.
I can't seem to get the loop function to work.
Thanks
Rich (BB code):
Private Sub Form_CurrentC()
On Error GoTo Err_Form_Current_Error
DoCmd.GoToRecord , , acNext
'advances you to next record
DoCmd.RunMacro "ApdTabtoTotalTest" 'the commands that you want to run
Exit Sub
Err_Form_Current_Error: 'this does nothing and holds back the error
End Sub
I can't seem to get the loop function to work.
Thanks
Last edited: