Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Value transfered to cell differs from value in record set

I use ADODB.Connection and ADODB.Recordset to pick up data from an Acess
database and transfer that data to a range on my spreadsheet. 99.999% of the
time I have perfect success with this which gives me some confidence that I'm
using the technique correctly (yeah ... right!).

I have found that a value retrieved from the database (the value is 0.002
and comes from a query result field defined as Standard, 3 decimal) is
transfered to the relevant cell on the spreadsheet as 0.000 (zero). The
target cell is defined as numeric, 3 decimal places and this does not change
before or after the transfer. Values from other rows of the same query
result field, and even values of other query result fields, also defined as
Standard, 3 decimals, transfer cleanly and correctly to their relvent target
cells.

I prepare the complete target area with ..Range(...).ClearContents to
preserve formatting.

I have executed the code in step and watch modes to verify that the value in
the record set just prior to the transfer is 0.002 ...

The transfer is achieved with .. .Cells(r, c + f).Formula = rs.Fields(f).Value

OS = Win Vista Ultimate
Excel 2003

Any help please? Thanks in advance



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Value transfered to cell differs from value in record set

Strange - does ... .Cells(r, c + f).Value= rs.Fields(f).Value make any
difference?

"Tony29" wrote:

I use ADODB.Connection and ADODB.Recordset to pick up data from an Acess
database and transfer that data to a range on my spreadsheet. 99.999% of the
time I have perfect success with this which gives me some confidence that I'm
using the technique correctly (yeah ... right!).

I have found that a value retrieved from the database (the value is 0.002
and comes from a query result field defined as Standard, 3 decimal) is
transfered to the relevant cell on the spreadsheet as 0.000 (zero). The
target cell is defined as numeric, 3 decimal places and this does not change
before or after the transfer. Values from other rows of the same query
result field, and even values of other query result fields, also defined as
Standard, 3 decimals, transfer cleanly and correctly to their relvent target
cells.

I prepare the complete target area with ..Range(...).ClearContents to
preserve formatting.

I have executed the code in step and watch modes to verify that the value in
the record set just prior to the transfer is 0.002 ...

The transfer is achieved with .. .Cells(r, c + f).Formula = rs.Fields(f).Value

OS = Win Vista Ultimate
Excel 2003

Any help please? Thanks in advance



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Value transfered to cell differs from value in record set

No - it doesn't make a difference. I had already tried it with ".Value" and
with no qualifier - same result.

However, your suggestion made me look at it again. I set a watch on the
target cell with Sheets("Sheet2").Range("R27") notation and then looked thru
the properties of the cell - maybe I missed something, but there is NO
".Value" property on a cell!!!??? There is a ".Value2" so I tried ...
..Cells(r, c + f).Value2= rs.Fields(f).Value and this works perfectly for all
target cells of all data types.

So, I guess in one respect the problem is solved ... but in another respect,
does Microsoft have something to explain about the inconsistent result
achieved using ... .Cells(r, c + f).Value= rs.Fields(f).Value

Thanks for your interest.
---------------------------------------------------------------------------------
"Smallweed" wrote:

Strange - does ... .Cells(r, c + f).Value= rs.Fields(f).Value make any
difference?


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
Validation List Question, Text in Cell DIffers to that Selected BaggieDan Excel Worksheet Functions 3 May 28th 09 10:10 AM
Formula Bar F9 Result differs from cell result??? Aaron Excel Worksheet Functions 3 May 15th 08 06:32 PM
Saving transfered data seags Excel Worksheet Functions 0 January 31st 06 01:21 AM
"the formula in this cell differs from the formula in this area o. ~Summiya~ Excel Worksheet Functions 1 November 27th 05 10:10 PM
the formula in this cell differs from formulas in this area of th turkey New Users to Excel 2 July 21st 05 05:27 PM


All times are GMT +1. The time now is 11:29 PM.

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

About Us

"It's about Microsoft Excel"