Sub Run_QRY()
Dim db As Database
Dim rs As Recordset
Dim intColIndex As Integer
Dim myDB As String
Dim FieldName As String
Dim MyCriteria As String
Dim TableName As String
Application.ScreenUpdating = False
Sheets("Bal-Day Report").Select
a = Range("A6")
'table
b = Range("A7")
'start date
c = Range("A8")
'stop date
myDB = "C:\Users\Scott\Documents\My Dropbox\Fundies DataBase\East Archives.accdb"
Set TargetRange = Sheets("Data").Range("A1")
' where the query results will be dropped
Set db = OpenDatabase(myDB)
Set rs = db.OpenRecordset("SELECT * FROM [" & a & "] WHERE [Date]>#" & b & "# And [Date]<#" & c & "#;", dbReadOnly)
' query database
For intColIndex = 0 To rs.Fields.Count - 1
TargetRange.Offset(0, intColIndex).Value = rs.Fields(intColIndex).Name
Next
' copy column headers
TargetRange.Offset(1, 0).CopyFromRecordset rs
' copy query results
Set rs = Nothing
db.Close
Set db = Nothing
Application.ScreenUpdating = True
End Sub