Please help, I'm new to VBA and I can't seem to figure this out...
I'm trying to run a looper to speed up my query...basically...I have a form that is connected to a table with a one field called "week." So far it runs fine unitl I get to the end of the table and I get an error msg stating that I'm at the end of the table. So my code stops and it doesn't contine on to the next set of queries.
How can I handle the end of the table. I don't think the "Do Until IsNull(week)" is right to end the loop.
DoCmd.GoToRecord acForm, "Frm_Cat_EOM", acFirst
Do Until IsNull(week)
DoCmd.OpenQuery "a020_qCan_LY_YTD_Cat", acViewNormal
DoCmd.GoToRecord acForm, "frm_Cat_EOM", acNext
Loop
Any assistance would greatly be appreciated.
Thanks,
Jan
I'm trying to run a looper to speed up my query...basically...I have a form that is connected to a table with a one field called "week." So far it runs fine unitl I get to the end of the table and I get an error msg stating that I'm at the end of the table. So my code stops and it doesn't contine on to the next set of queries.
How can I handle the end of the table. I don't think the "Do Until IsNull(week)" is right to end the loop.
DoCmd.GoToRecord acForm, "Frm_Cat_EOM", acFirst
Do Until IsNull(week)
DoCmd.OpenQuery "a020_qCan_LY_YTD_Cat", acViewNormal
DoCmd.GoToRecord acForm, "frm_Cat_EOM", acNext
Loop
Any assistance would greatly be appreciated.
Thanks,
Jan