Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JT JT is offline
external usenet poster
 
Posts: 234
Default recordset question

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default recordset question

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default recordset question



"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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default recordset question

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

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default recordset question

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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
ADO recordset Kirk P. Excel Programming 2 April 6th 07 07:22 PM
VBA question: adding a row to worksheet from recordset row HockeyFan Excel Programming 1 February 14th 07 05:02 PM
Need ADO Recordset Help Mr B[_2_] Excel Programming 9 April 21st 06 04:51 PM
Type recordset/recordset? FlaviusFlav[_9_] Excel Programming 4 May 24th 04 12:16 PM
Recordset Stephan Kassanke Excel Programming 0 September 10th 03 04:45 PM


All times are GMT +1. The time now is 07:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"