Very bad....but I never have put in error handling, but just read up on it and it make sense to have!! However, after thinking it would be easy to add this fails "Label not defined" and highlights the second line.....any ideas?
Private Sub RunAllQueries___Click()
On Error GoTo Err_RunAllQueries
DoCmd.Hourglass True
Dim myQueries() As String, i As Integer, myDb As Database
Set myDb = CurrentDb
ReDim myQueries(3)
myQueries(0) = "0 - Clear Out yealry accamend - required tbl"
myQueries(1) = "0 - Clear Out yearly acc amend tbl"
myQueries(2) = "0 Clear out ALL DATA table"
myQueries(3) = "0 Clear out Merged_Stock Table"
For i = 0 To UBound(myQueries)
DoCmd.Echo True, "Running query " & i + 1 & " of 4 please wait...."
myDb.Execute myQueries(i)
Next
DoCmd.Hourglass False
Exit_RunAllQueries:
End Sub
Err_RunAllQueries:
MsgBox Err.Description
Resume Exit_RunAllQueries
End Sub