B
Bob Barnes
I am sending Access data to Excel. I want to list the
FieldNames in an Excel Named Range directly above the
data returned by the Access Query & sent to Excel.
Looking for sample code to take the Field Names & use
a For Each to get all the FieldNames & then send to another
Table...then send to Excel.
I tried something like this, but it didn't recognize the
FD.Name. . .
Set Z = CurrentDb
Set AQQ = Z.QueryDefs("Bob")
For Each PM In AQQ.Parameters
PM.Value = Eval(PM.Name)
Next PM
Set RS = AQQ.OpenRecordset()
With RS
If Not .BOF Then
Q = "DELETE * FROM FiveGo;"
Z.Execute Q
For Each FD In RS.Fields
'MsgBox FD.Name ---> FD.Name did not appear
TIA - Bob
FieldNames in an Excel Named Range directly above the
data returned by the Access Query & sent to Excel.
Looking for sample code to take the Field Names & use
a For Each to get all the FieldNames & then send to another
Table...then send to Excel.
I tried something like this, but it didn't recognize the
FD.Name. . .
Set Z = CurrentDb
Set AQQ = Z.QueryDefs("Bob")
For Each PM In AQQ.Parameters
PM.Value = Eval(PM.Name)
Next PM
Set RS = AQQ.OpenRecordset()
With RS
If Not .BOF Then
Q = "DELETE * FROM FiveGo;"
Z.Execute Q
For Each FD In RS.Fields
'MsgBox FD.Name ---> FD.Name did not appear
TIA - Bob