Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using ADO to create a recordset from an Access Database
The recordset has 10 fields. Not all 10 fields have a value. I would like to place the first field with a value in row 1, column 1 and the second field with a value in row 2, column 2 Any suggestions or sample code to accomplish this would be greatly appreciated. Thanks for the help... -- JT |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i = 1
rs.MoveFirst Do While Not rs.EOF If rs.Fields(1) < "" Then Cells(i, i).Value = rs.Fields(1) i = i + 1 End If rs.movenext Loop -- __________________________________ HTH Bob "JT" wrote in message ... I am using ADO to create a recordset from an Access Database The recordset has 10 fields. Not all 10 fields have a value. I would like to place the first field with a value in row 1, column 1 and the second field with a value in row 2, column 2 Any suggestions or sample code to accomplish this would be greatly appreciated. Thanks for the help... -- JT |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Bob do you think that he means something like this?
iRow = 2 iCol = 1 Do While (Not rs.EOF) For Each fld In rs.Fields If fld.Value < "" Then Cells(iRow, iCol) = fld.Value iCol = iCol + 1 iRow= iRow+ 1 End If Next rs.MoveNext Loop "Bob Phillips" wrote: i = 1 rs.MoveFirst Do While Not rs.EOF If rs.Fields(1) < "" Then Cells(i, i).Value = rs.Fields(1) i = i + 1 End If rs.movenext Loop -- __________________________________ HTH Bob "JT" wrote in message ... I am using ADO to create a recordset from an Access Database The recordset has 10 fields. Not all 10 fields have a value. I would like to place the first field with a value in row 1, column 1 and the second field with a value in row 2, column 2 Any suggestions or sample code to accomplish this would be greatly appreciated. Thanks for the help... -- JT |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "JT" wrote: I am using ADO to create a recordset from an Access Database The recordset has 10 fields. Not all 10 fields have a value. I would like to place the first field with a value in row 1, column 1 and the second field with a value in row 2, column 2 Any suggestions or sample code to accomplish this would be greatly appreciated. Thanks for the help... -- JT |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If Bob's suggestion is working for you then ok. If not give more detail for
what you need. "JT" wrote: I am using ADO to create a recordset from an Access Database The recordset has 10 fields. Not all 10 fields have a value. I would like to place the first field with a value in row 1, column 1 and the second field with a value in row 2, column 2 Any suggestions or sample code to accomplish this would be greatly appreciated. Thanks for the help... -- JT |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ADO recordset | Excel Programming | |||
VBA question: adding a row to worksheet from recordset row | Excel Programming | |||
Need ADO Recordset Help | Excel Programming | |||
Type recordset/recordset? | Excel Programming | |||
Recordset | Excel Programming |