Here is my code:
Code:
Private Sub runreport_Click()
DoCmd.SetWarnings False
Dim runn As Integer
Dim starttime As String
Dim endtime As String
Dim ftime As String
Dim ssql(1 To 7) As String
ssql(1) = "LMSB_Recharges"
ssql(2) = "LMSB_Volume"
ssql(3) = "LMSB_Wextras"
ssql(4) = "LMSB_WType_Q"
ssql(5) = "PriorSales_Append"
ssql(6) = "GF_NoNote_RemovedARM"
ssql(7) = "GF_Month_Signup"
starttime = Timer
For runn = 1 To 7
DoCmd.OpenQuery ssql(runn)
Next runn
DoCmd.SetWarnings True
endtime = Timer
ftime = Format(((endtime - starttime) / 86400), "hh:mm:ss")
Debug.Print ftime
DoCmd.OpenReport "TestReport_Table", acViewReport
End Sub
I do not know where to begin to do research on this issue. For some reason, If I run this code once, nothing appends except my sales. If I run it a 2nd time, all the following queries append including the sales twice. Any clue why the queries don't append on the first run?