Sub Timethis()
'time .Execute vs. openquery vs. runsql, and maybe observe bloat
'1. Create a Query1. Maybe start with a select query; maybe a make table query (to check bloating?) However .execute won't like doing a "make table" if the table already exists; you might want to destroy it.
'DoCmd.SetWarnings False - does not appear to work with .Execute - (right, Gina?)
'2. Set variable sSQL
'3. set the CONST and run.
Const NUM_LOOPS = 1
Dim dStart As Double, i As Long, sSQL As String
'**** SET sSQL HERE ****
sSQL = "SELECT ... " _
& " INTO NewTable " _
& " FROM sometable;"
DoCmd.SetWarnings False
Debug.Print "start exec saved query:" & Now: dStart = Now
For i = 1 To NUM_LOOPS
CurrentDb.Execute "Query1"
Next i
Debug.Print "end exec saved query:" & Now, CInt((Now - dStart) * 60 * 60 * 240#)
Stop 'optionally stop here to check the bloat, such as from a make table query
Debug.Print "start exec SQL:" & Now: dStart = Now
For i = 1 To NUM_LOOPS
CurrentDb.Execute sSQL
Next i
Debug.Print "end exec SQL:" & Now, CInt((Now - dStart) * 60 * 60 * 240#)
Stop 'optionally stop here to check the bloat, such as from a make table query
Debug.Print "start openquery:" & Now: dStart = Now
For i = 1 To NUM_LOOPS
DoCmd.OpenQuery "Query1"
Next i
Debug.Print "end openquery:" & Now, CInt((Now - dStart) * 60 * 60 * 240#)
Stop 'optionally stop here to check the bloat, such as from a make table query
Debug.Print "start runsql:" & Now: dStart = Now
For i = 1 To NUM_LOOPS
DoCmd.RunSQL sSQL
Next i
Debug.Print "end runsql:" & Now, CInt((Now - dStart) * 60 * 60 * 240#)
Stop 'optionally stop here to check the bloat, such as from a make table query
DoCmd.SetWarnings True
End Sub