Ashish Batham
Member
Set rs = db.OpenRecordset(strQuery)
If (rs.RecordCount > 0) Then
cnt = 1
For Each fld In rs.Fields
wks.Cells(1, cnt).Value = fld.Name
cnt = cnt + 1
Next fld
Call rng.CopyFromRecordset(rs, 4000, 26)
End If
If (rs.RecordCount > 0) Then
cnt = 1
For Each fld In rs.Fields
wks.Cells(1, cnt).Value = fld.Name
cnt = cnt + 1
Next fld
Call rng.CopyFromRecordset(rs, 4000, 26)
End If