Crosstab Query Column Headings

B

Bob Barnes

Sorry...this is a cross-post (is also in "General questions", but NO replies
yet...if this is doable).

I'm uUsing automation to Excel.

Can I get the Column Headings..IE - Apr - May - Jun - Jul...
to transfer along w/ the automation? If not, I'll have to code for that.

TIA - Bob
 
D

Duane Hookom

Can you tell us what you are doing in a little more detail? You should be
able to get the field names if you are using a recordset.
 
B

Bob Barnes

Duane - You are correct. I realized that when I was walking into the Plant
this AM.

Thank you - Bob
 
B

Bob Barnes

Didn't get that I needed from the For Each FD in .Fields.

Can I get "TheMonth" values by Pivot??..below??
TRANSFORM Sum(MarvinMan.TheQty) AS SumOfTheQty
SELECT MarvinMan.TheTM
FROM MarvinMan
GROUP BY MarvinMan.TheTM
PIVOT MarvinMan.TheMonth;

TIA - Bob
 
D

Duane Hookom

You should be able to get the pivot values from this query:

SELECT DISTINCT MarvinMan.TheMonth
FROM MarvinMan;
 
B

Bob Barnes

Duane - Beautiful...

Code like this got TheMonth's values..

Set Z = CurrentDb
Q = "SELECT DISTINCT MarvinMan.TheMonth FROM MarvinMan;"
Set RS = Z.OpenRecordset(Q, dbOpenSnapshot)
With RS
If Not .BOF Then
Do Until .EOF
MsgBox !TheMonth
.MoveNext
Loop
End If
.Close: Set RS = Nothing: Z.Close: Set Z = Nothing
End With

Thank you - Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top