From: HarvestWind@comcast.net   
      
   Great, Steve... Thanks a million.   
      
   JP   
   "Steve Gerrard" wrote in message   
   news:I5ednY9o0pyvh9zZRVn-rQ@comcast.com...   
   >   
   > "Joe-Paul" wrote in message   
   > news:SYqdnbahdvoR2N3ZnZ2dnUVZ_umdnZ2d@comcast.com...   
   >> Hi:   
   >>   
   >> I'm using a "CrossTab" Query to retrieve data. When I get it back, I   
   >> want   
   >> to print the column Headers along the first row of the grid. How to I   
   >> get   
   >> the names of the column Headers?   
   >   
   > Any recordset, regardless of what sort of query you use to get it, will   
   > include a Fields collection.   
   > So something like this will get you the information you need:   
   >   
   > Dim oRS As Recordset   
   > Dim oFld As Field   
   >   
   > ' get data into oRS...   
   >   
   > ' The number of columns is.oRS.Fields.Count.   
   > Debug.Print "columns needed: " & oRS.Fields.Count   
   >   
   > For Each oFld In oRS.Fields   
   > ' do something here with each field name   
   > Debug.Print oFld.Name   
   > Next oFld   
   >   
   > Now you can play with setting up the grid and labelling the column   
   > headers...   
   >   
   >   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|