OrbitMascot
Programmer
I am working with an automated ordering system. Shops place their orders via email, and the database breaks the orders down. The database is always running, but every couple of days I get an error stating "Array Index Out of Bounds" and it stops the automated system. I have included an Error trap so I am not sure why the error stops the database. Any assistance would be greatly appreciated.
Thanks,
OrbitMascot
Below is the beginning and ending code.
On Error GoTo Stop_Crash
iCount = molItems.Count
For i = 1 To iCount
If TypeName(molItems(i)) = "MailItem" Then '''''' Error highlights this line.
'run procedure
End If
Forms!Main.TimerInterval = 60000
DoCmd.Close acForm, "Automated", acSaveYes
Exit Sub
Stop_Crash:
Forms!Main.TimerInterval = 60000
DoCmd.Close acForm, "Automated", acSaveYes
End Sub
Thanks,
OrbitMascot
Below is the beginning and ending code.
On Error GoTo Stop_Crash
iCount = molItems.Count
For i = 1 To iCount
If TypeName(molItems(i)) = "MailItem" Then '''''' Error highlights this line.
'run procedure
End If
Forms!Main.TimerInterval = 60000
DoCmd.Close acForm, "Automated", acSaveYes
Exit Sub
Stop_Crash:
Forms!Main.TimerInterval = 60000
DoCmd.Close acForm, "Automated", acSaveYes
End Sub