Hi all,
Still new to VBA and I am trying to create a function that runs an append query like this:
Dim strSQL_1, strSQL_2, strSQL_3 As String
strSQL_1 = "INSERT INTO tblConsolidate([variable]) SELECT [variable] FROM qryResults"
strSQL_2 = "......FROM qryOtherResults"
...so on and so forth
Docmd.RunSQL strSQL_1
Docmd.RunSQL strSQL_2
Because I am such a lazy person and the number of queries might increase in the future, I am trying to get a loop done...
Dim i as Integer
For i = 1 TO 3
Docmd.RunSQL strSQL_i
Next i
End Sub
But I have yet figured out a way to substitute the integer at the end of strSQL_.
Can this be done? Thanks in advance!
Still new to VBA and I am trying to create a function that runs an append query like this:
Dim strSQL_1, strSQL_2, strSQL_3 As String
strSQL_1 = "INSERT INTO tblConsolidate([variable]) SELECT [variable] FROM qryResults"
strSQL_2 = "......FROM qryOtherResults"
...so on and so forth
Docmd.RunSQL strSQL_1
Docmd.RunSQL strSQL_2
Because I am such a lazy person and the number of queries might increase in the future, I am trying to get a loop done...
Dim i as Integer
For i = 1 TO 3
Docmd.RunSQL strSQL_i
Next i
End Sub
But I have yet figured out a way to substitute the integer at the end of strSQL_.
Can this be done? Thanks in advance!