Thread: Column Name
View Single Post
  #3  
Old May 13th, 2010, 04:22 PM posted to microsoft.public.access.gettingstarted
Bre-x
external usenet poster
 
Posts: 103
Default Column Name

Thank you, Now how could I find out how many columns are there?

If rst!column3 does not exits the code stop executing: "Item not found in
this collection"



"Arvin Meyer [MVP]" wrote in message
...
In your example, it is the first column and second column, so:

objSht.Cells(iRow, 1).Value = rst!column1
objSht.Cells(iRow, 1).Value = rst!column2

should be:

objSht.Cells(iRow, 1).Value = rst!column1
objSht.Cells(iRow, 2).Value = rst!column2
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.accessmvp.com
http://www.mvps.org/access